From a53b9f424788ce2185af5a22ff6d146f0998c731 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 29 Jan 2024 22:02:13 +0000 Subject: [PATCH] CodeGen from PR 26644 in Azure/azure-rest-api-specs Merge ec595dbd3a1704c555f1c0ff13697656f15beabd into c26e839257aa638ca19da0007207bb4109655375 --- .../azure-resourcemanager-scvmm/CHANGELOG.md | 4 +- .../azure-resourcemanager-scvmm/README.md | 31 +- .../azure-resourcemanager-scvmm/SAMPLE.md | 1220 ++---- sdk/scvmm/azure-resourcemanager-scvmm/pom.xml | 11 +- .../resourcemanager/scvmm/ScvmmManager.java | 223 +- .../scvmm/fluent/AvailabilitySetsClient.java | 265 +- .../scvmm/fluent/CloudsClient.java | 257 +- .../scvmm/fluent/GuestAgentsClient.java | 148 + .../scvmm/fluent/InventoryItemsClient.java | 132 +- .../scvmm/fluent/OperationsClient.java | 24 +- .../scvmm/fluent/ScvmmClient.java | 82 +- .../fluent/VirtualMachineInstancesClient.java | 559 +++ .../fluent/VirtualMachineTemplatesClient.java | 244 +- .../scvmm/fluent/VirtualMachinesClient.java | 685 ---- .../scvmm/fluent/VirtualNetworksClient.java | 244 +- ...InstanceHybridIdentityMetadatasClient.java | 70 + .../scvmm/fluent/VmmServersClient.java | 260 +- .../fluent/models/AvailabilitySetInner.java | 133 +- .../scvmm/fluent/models/CloudInner.java | 189 +- .../scvmm/fluent/models/GuestAgentInner.java | 75 + .../fluent/models/InventoryItemInner.java | 109 +- .../scvmm/fluent/models/OperationInner.java | 129 + .../ResourceProviderOperationInner.java | 102 - .../fluent/models/VirtualMachineInner.java | 460 --- .../models/VirtualMachineInstanceInner.java | 111 + .../models/VirtualMachineProperties.java | 439 --- .../models/VirtualMachineTemplateInner.java | 295 +- .../fluent/models/VirtualNetworkInner.java | 170 +- ...VmInstanceHybridIdentityMetadataInner.java | 75 + .../scvmm/fluent/models/VmmServerInner.java | 196 +- .../scvmm/fluent/models/package-info.java | 5 +- .../scvmm/fluent/package-info.java | 5 +- .../implementation/AvailabilitySetImpl.java | 101 +- .../AvailabilitySetsClientImpl.java | 1653 ++++---- .../implementation/AvailabilitySetsImpl.java | 173 +- .../scvmm/implementation/CloudImpl.java | 113 +- .../implementation/CloudsClientImpl.java | 1583 ++++---- .../scvmm/implementation/CloudsImpl.java | 156 +- .../scvmm/implementation/GuestAgentImpl.java | 49 + .../implementation/GuestAgentsClientImpl.java | 673 ++++ .../scvmm/implementation/GuestAgentsImpl.java | 91 + .../implementation/InventoryItemImpl.java | 64 +- .../InventoryItemsClientImpl.java | 874 ++--- .../implementation/InventoryItemsImpl.java | 184 +- .../scvmm/implementation/OperationImpl.java | 50 + .../implementation/OperationsClientImpl.java | 212 +- .../scvmm/implementation/OperationsImpl.java | 16 +- .../{Utils.java => ResourceManagerUtils.java} | 45 +- .../ResourceProviderOperationImpl.java | 41 - .../implementation/ScvmmClientBuilder.java | 53 +- .../scvmm/implementation/ScvmmClientImpl.java | 245 +- .../implementation/VirtualMachineImpl.java | 409 -- .../VirtualMachineInstanceImpl.java | 55 + .../VirtualMachineInstancesClientImpl.java | 2253 +++++++++++ .../VirtualMachineInstancesImpl.java | 164 + .../VirtualMachineTemplateImpl.java | 173 +- .../VirtualMachineTemplatesClientImpl.java | 1650 ++++---- .../VirtualMachineTemplatesImpl.java | 156 +- .../VirtualMachinesClientImpl.java | 3353 ----------------- .../implementation/VirtualMachinesImpl.java | 255 -- .../implementation/VirtualNetworkImpl.java | 99 +- .../VirtualNetworksClientImpl.java | 1572 ++++---- .../implementation/VirtualNetworksImpl.java | 141 +- .../VmInstanceHybridIdentityMetadataImpl.java | 50 + ...anceHybridIdentityMetadatasClientImpl.java | 369 ++ ...VmInstanceHybridIdentityMetadatasImpl.java | 72 + .../scvmm/implementation/VmmServerImpl.java | 112 +- .../implementation/VmmServersClientImpl.java | 1595 ++++---- .../scvmm/implementation/VmmServersImpl.java | 133 +- .../scvmm/implementation/package-info.java | 5 +- .../scvmm/models/ActionType.java | 48 + .../scvmm/models/AllocationMethod.java | 25 +- .../scvmm/models/AvailabilitySet.java | 192 +- .../scvmm/models/AvailabilitySetListItem.java | 20 +- .../models/AvailabilitySetListResult.java | 42 +- .../models/AvailabilitySetProperties.java | 32 +- .../models/AvailabilitySetTagsUpdate.java | 57 + .../scvmm/models/AvailabilitySets.java | 117 +- .../scvmm/models/Checkpoint.java | 28 +- .../resourcemanager/scvmm/models/Cloud.java | 214 +- .../scvmm/models/CloudCapacity.java | 45 +- .../scvmm/models/CloudInventoryItem.java | 13 +- .../scvmm/models/CloudListResult.java | 42 +- .../{fluent => }/models/CloudProperties.java | 62 +- ...esourcePatch.java => CloudTagsUpdate.java} | 22 +- .../resourcemanager/scvmm/models/Clouds.java | 115 +- .../scvmm/models/CreateDiffDisk.java | 27 +- .../scvmm/models/DynamicMemoryEnabled.java | 27 +- .../scvmm/models/ExtendedLocation.java | 20 +- .../scvmm/models/GuestAgent.java | 55 + .../scvmm/models/GuestAgentListResult.java | 91 + .../scvmm/models/GuestAgentProperties.java | 172 + .../scvmm/models/GuestAgents.java | 108 + .../scvmm/models/GuestCredential.java | 91 + .../scvmm/models/HardwareProfile.java | 58 +- .../scvmm/models/HardwareProfileUpdate.java | 179 - .../scvmm/models/HttpProxyConfiguration.java | 54 + .../scvmm/models/InfrastructureProfile.java | 310 ++ .../scvmm/models/InventoryItem.java | 111 +- .../scvmm/models/InventoryItemDetails.java | 26 +- ...List.java => InventoryItemListResult.java} | 75 +- .../models/InventoryItemProperties.java | 47 +- .../scvmm/models/InventoryItems.java | 100 +- .../scvmm/models/InventoryType.java | 44 - .../scvmm/models/IsCustomizable.java | 27 +- .../scvmm/models/IsHighlyAvailable.java | 53 + .../scvmm/models/LimitCpuForMigration.java | 27 +- ...kInterfaces.java => NetworkInterface.java} | 100 +- .../scvmm/models/NetworkInterfacesUpdate.java | 205 - .../scvmm/models/NetworkProfile.java | 25 +- .../scvmm/models/NetworkProfileUpdate.java | 53 - .../scvmm/models/Operation.java | 58 + .../scvmm/models/OperationDisplay.java | 95 + .../scvmm/models/OperationListResult.java | 64 + .../scvmm/models/Operations.java | 22 +- .../resourcemanager/scvmm/models/Origin.java | 59 + ...ofile.java => OsProfileForVmInstance.java} | 67 +- .../resourcemanager/scvmm/models/OsType.java | 29 +- .../scvmm/models/ProvisioningAction.java | 58 + .../scvmm/models/ProvisioningState.java | 83 + .../models/ResourceProviderOperation.java | 38 - .../ResourceProviderOperationDisplay.java | 124 - .../models/ResourceProviderOperationList.java | 77 - .../scvmm/models/SkipShutdown.java | 53 + .../models/StopVirtualMachineOptions.java | 27 +- .../scvmm/models/StorageProfile.java | 19 +- .../scvmm/models/StorageProfileUpdate.java | 51 - ...geQoSPolicy.java => StorageQosPolicy.java} | 74 +- ...ails.java => StorageQosPolicyDetails.java} | 30 +- .../scvmm/models/VirtualDisk.java | 94 +- .../scvmm/models/VirtualDiskUpdate.java | 231 -- .../scvmm/models/VirtualMachine.java | 648 ---- .../VirtualMachineCreateCheckpoint.java | 20 +- .../VirtualMachineDeleteCheckpoint.java | 16 +- .../scvmm/models/VirtualMachineInstance.java | 62 + .../VirtualMachineInstanceListResult.java | 91 + .../VirtualMachineInstanceProperties.java | 233 ++ .../models/VirtualMachineInstanceUpdate.java | 86 + ...irtualMachineInstanceUpdateProperties.java | 204 + .../scvmm/models/VirtualMachineInstances.java | 274 ++ .../models/VirtualMachineInventoryItem.java | 80 +- .../models/VirtualMachineListResult.java | 77 - .../VirtualMachineRestoreCheckpoint.java | 16 +- .../scvmm/models/VirtualMachineTemplate.java | 292 +- .../VirtualMachineTemplateInventoryItem.java | 33 +- .../VirtualMachineTemplateListResult.java | 42 +- .../VirtualMachineTemplateProperties.java | 130 +- .../VirtualMachineTemplateTagsUpdate.java | 57 + .../scvmm/models/VirtualMachineTemplates.java | 115 +- .../scvmm/models/VirtualMachineUpdate.java | 78 - .../VirtualMachineUpdateProperties.java | 137 - .../scvmm/models/VirtualMachines.java | 369 -- .../scvmm/models/VirtualNetwork.java | 199 +- .../models/VirtualNetworkInventoryItem.java | 13 +- .../models/VirtualNetworkListResult.java | 42 +- .../models/VirtualNetworkProperties.java | 38 +- .../models/VirtualNetworkTagsUpdate.java | 57 + .../scvmm/models/VirtualNetworks.java | 115 +- .../VmInstanceHybridIdentityMetadata.java | 55 + ...tanceHybridIdentityMetadataListResult.java | 91 + ...tanceHybridIdentityMetadataProperties.java | 95 + .../VmInstanceHybridIdentityMetadatas.java | 62 + ...iesCredentials.java => VmmCredential.java} | 42 +- .../scvmm/models/VmmServer.java | 220 +- .../scvmm/models/VmmServerListResult.java | 42 +- .../models/VmmServerProperties.java | 71 +- .../scvmm/models/VmmServerTagsUpdate.java | 57 + .../scvmm/models/VmmServers.java | 123 +- .../scvmm/models/package-info.java | 5 +- .../resourcemanager/scvmm/package-info.java | 5 +- .../src/main/java/module-info.java | 8 +- .../proxy-config.json | 1 + .../reflect-config.json | 371 ++ ...AvailabilitySetsCreateOrUpdateSamples.java | 35 - .../AvailabilitySetsDeleteSamples.java | 22 - ...labilitySetsGetByResourceGroupSamples.java | 22 - ...abilitySetsListByResourceGroupSamples.java | 22 - .../AvailabilitySetsListSamples.java | 22 - .../AvailabilitySetsUpdateSamples.java | 41 - .../CloudsCreateOrUpdateSamples.java | 43 +- .../scvmm/generated/CloudsDeleteSamples.java | 30 +- .../CloudsGetByResourceGroupSamples.java | 30 +- .../CloudsListByResourceGroupSamples.java | 32 +- .../scvmm/generated/CloudsListSamples.java | 32 +- .../scvmm/generated/CloudsUpdateSamples.java | 43 +- .../InventoryItemsCreateSamples.java | 24 - .../InventoryItemsDeleteSamples.java | 24 - .../generated/InventoryItemsGetSamples.java | 24 - .../InventoryItemsListByVmmServerSamples.java | 22 - .../generated/OperationsListSamples.java | 32 +- ...MachineTemplatesCreateOrUpdateSamples.java | 35 - .../VirtualMachineTemplatesDeleteSamples.java | 22 - ...ineTemplatesGetByResourceGroupSamples.java | 24 - ...neTemplatesListByResourceGroupSamples.java | 23 - .../VirtualMachineTemplatesListSamples.java | 22 - .../VirtualMachineTemplatesUpdateSamples.java | 41 - ...irtualMachinesCreateCheckpointSamples.java | 31 - .../VirtualMachinesCreateOrUpdateSamples.java | 40 - ...irtualMachinesDeleteCheckpointSamples.java | 26 - .../VirtualMachinesDeleteSamples.java | 22 - ...tualMachinesGetByResourceGroupSamples.java | 22 - ...ualMachinesListByResourceGroupSamples.java | 22 - .../generated/VirtualMachinesListSamples.java | 22 - .../VirtualMachinesRestartSamples.java | 22 - ...rtualMachinesRestoreCheckpointSamples.java | 26 - .../VirtualMachinesStartSamples.java | 22 - .../generated/VirtualMachinesStopSamples.java | 25 - .../VirtualMachinesUpdateSamples.java | 65 - .../VirtualNetworksCreateOrUpdateSamples.java | 30 +- .../VirtualNetworksDeleteSamples.java | 22 - ...tualNetworksGetByResourceGroupSamples.java | 32 +- ...ualNetworksListByResourceGroupSamples.java | 22 - .../generated/VirtualNetworksListSamples.java | 22 - .../VirtualNetworksUpdateSamples.java | 41 - .../VmmServersCreateOrUpdateSamples.java | 44 +- .../generated/VmmServersDeleteSamples.java | 32 +- .../VmmServersGetByResourceGroupSamples.java | 32 +- .../VmmServersListByResourceGroupSamples.java | 32 +- .../generated/VmmServersListSamples.java | 32 +- .../generated/VmmServersUpdateSamples.java | 46 +- 220 files changed, 16536 insertions(+), 20091 deletions(-) create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/GuestAgentsClient.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachineInstancesClient.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachinesClient.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VmInstanceHybridIdentityMetadatasClient.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/GuestAgentInner.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/OperationInner.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/ResourceProviderOperationInner.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineInner.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineInstanceInner.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineProperties.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmInstanceHybridIdentityMetadataInner.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentsClientImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentsImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationImpl.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/{Utils.java => ResourceManagerUtils.java} (79%) delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ResourceProviderOperationImpl.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstanceImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstancesClientImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstancesImpl.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachinesClientImpl.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachinesImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadataImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadatasClientImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadatasImpl.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ActionType.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/{fluent => }/models/AvailabilitySetProperties.java (81%) create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetTagsUpdate.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/{fluent => }/models/CloudProperties.java (78%) rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/{ResourcePatch.java => CloudTagsUpdate.java} (75%) create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgent.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgentListResult.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgentProperties.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgents.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestCredential.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HardwareProfileUpdate.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HttpProxyConfiguration.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InfrastructureProfile.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/{InventoryItemsList.java => InventoryItemListResult.java} (57%) rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/{fluent => }/models/InventoryItemProperties.java (74%) delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryType.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/IsHighlyAvailable.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/{NetworkInterfaces.java => NetworkInterface.java} (77%) delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterfacesUpdate.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkProfileUpdate.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Operation.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OperationDisplay.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OperationListResult.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Origin.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/{OsProfile.java => OsProfileForVmInstance.java} (60%) create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ProvisioningAction.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ProvisioningState.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperation.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperationDisplay.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperationList.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/SkipShutdown.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageProfileUpdate.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/{StorageQoSPolicy.java => StorageQosPolicy.java} (73%) rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/{StorageQoSPolicyDetails.java => StorageQosPolicyDetails.java} (72%) delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualDiskUpdate.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachine.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstance.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceListResult.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceProperties.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceUpdate.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceUpdateProperties.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstances.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineListResult.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/{fluent => }/models/VirtualMachineTemplateProperties.java (71%) create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateTagsUpdate.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineUpdate.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineUpdateProperties.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachines.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/{fluent => }/models/VirtualNetworkProperties.java (86%) create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkTagsUpdate.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadata.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadataListResult.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadataProperties.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadatas.java rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/{VmmServerPropertiesCredentials.java => VmmCredential.java} (64%) rename sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/{fluent => }/models/VmmServerProperties.java (75%) create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerTagsUpdate.java create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-scvmm/proxy-config.json create mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-scvmm/reflect-config.json delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsCreateOrUpdateSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsDeleteSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsGetByResourceGroupSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsListByResourceGroupSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsListSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsUpdateSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsCreateSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsDeleteSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsGetSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsListByVmmServerSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesCreateOrUpdateSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesDeleteSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesGetByResourceGroupSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesListByResourceGroupSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesListSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesUpdateSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesCreateCheckpointSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesCreateOrUpdateSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesDeleteCheckpointSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesDeleteSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesGetByResourceGroupSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesListByResourceGroupSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesListSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesRestartSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesRestoreCheckpointSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesStartSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesStopSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesUpdateSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksDeleteSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksListByResourceGroupSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksListSamples.java delete mode 100644 sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksUpdateSamples.java diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/CHANGELOG.md b/sdk/scvmm/azure-resourcemanager-scvmm/CHANGELOG.md index 0b5e7e93c01f4..fbb3f986d1331 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/CHANGELOG.md +++ b/sdk/scvmm/azure-resourcemanager-scvmm/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2024-01-29) + +- Azure Resource Manager Scvmm client library for Java. This package contains Microsoft Azure SDK for Scvmm Management SDK. SCVMM Client. Package tag package-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/README.md b/sdk/scvmm/azure-resourcemanager-scvmm/README.md index 6c9082af7db66..b75fdc32192c1 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/README.md +++ b/sdk/scvmm/azure-resourcemanager-scvmm/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Scvmm client library for Java. -This package contains Microsoft Azure SDK for Scvmm Management SDK. SCVMM Client. Package tag package-2020-06-05-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Scvmm Management SDK. SCVMM Client. Package tag package-2023-10. 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-scvmm - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,20 +83,25 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fscvmm%2Fazure-resourcemanager-scvmm%2FREADME.png) diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/SAMPLE.md b/sdk/scvmm/azure-resourcemanager-scvmm/SAMPLE.md index 9c305aee14f41..4406eb634458d 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/SAMPLE.md +++ b/sdk/scvmm/azure-resourcemanager-scvmm/SAMPLE.md @@ -1,15 +1,6 @@ # Code snippets and samples -## AvailabilitySets - -- [CreateOrUpdate](#availabilitysets_createorupdate) -- [Delete](#availabilitysets_delete) -- [GetByResourceGroup](#availabilitysets_getbyresourcegroup) -- [List](#availabilitysets_list) -- [ListByResourceGroup](#availabilitysets_listbyresourcegroup) -- [Update](#availabilitysets_update) - ## Clouds - [CreateOrUpdate](#clouds_createorupdate) @@ -19,49 +10,14 @@ - [ListByResourceGroup](#clouds_listbyresourcegroup) - [Update](#clouds_update) -## InventoryItems - -- [Create](#inventoryitems_create) -- [Delete](#inventoryitems_delete) -- [Get](#inventoryitems_get) -- [ListByVmmServer](#inventoryitems_listbyvmmserver) - ## Operations - [List](#operations_list) -## VirtualMachineTemplates - -- [CreateOrUpdate](#virtualmachinetemplates_createorupdate) -- [Delete](#virtualmachinetemplates_delete) -- [GetByResourceGroup](#virtualmachinetemplates_getbyresourcegroup) -- [List](#virtualmachinetemplates_list) -- [ListByResourceGroup](#virtualmachinetemplates_listbyresourcegroup) -- [Update](#virtualmachinetemplates_update) - -## VirtualMachines - -- [CreateCheckpoint](#virtualmachines_createcheckpoint) -- [CreateOrUpdate](#virtualmachines_createorupdate) -- [Delete](#virtualmachines_delete) -- [DeleteCheckpoint](#virtualmachines_deletecheckpoint) -- [GetByResourceGroup](#virtualmachines_getbyresourcegroup) -- [List](#virtualmachines_list) -- [ListByResourceGroup](#virtualmachines_listbyresourcegroup) -- [Restart](#virtualmachines_restart) -- [RestoreCheckpoint](#virtualmachines_restorecheckpoint) -- [Start](#virtualmachines_start) -- [Stop](#virtualmachines_stop) -- [Update](#virtualmachines_update) - ## VirtualNetworks - [CreateOrUpdate](#virtualnetworks_createorupdate) -- [Delete](#virtualnetworks_delete) - [GetByResourceGroup](#virtualnetworks_getbyresourcegroup) -- [List](#virtualnetworks_list) -- [ListByResourceGroup](#virtualnetworks_listbyresourcegroup) -- [Update](#virtualnetworks_update) ## VmmServers @@ -71,278 +27,169 @@ - [List](#vmmservers_list) - [ListByResourceGroup](#vmmservers_listbyresourcegroup) - [Update](#vmmservers_update) -### AvailabilitySets_CreateOrUpdate +### Clouds_CreateOrUpdate ```java import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -/** Samples for AvailabilitySets CreateOrUpdate. */ -public final class AvailabilitySetsCreateOrUpdateSamples { +/** + * Samples for Clouds CreateOrUpdate. + */ +public final class CloudsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateAvailabilitySet.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MinimumSet_Gen.json */ /** - * Sample code: CreateAvailabilitySet. - * + * Sample code: CreateCloud - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void createAvailabilitySet(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .availabilitySets() - .define("HRAvailabilitySet") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withAvailabilitySetName("hr-avset") - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/VMMServers/ContosoVMMServer") - .create(); + public static void createCloudGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().define("_").withRegion((String) null).withExistingResourceGroup("rgscvmm").withExtendedLocation((ExtendedLocation) null).create(); } -} -``` -### AvailabilitySets_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for AvailabilitySets Delete. */ -public final class AvailabilitySetsDeleteSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteAvailabilitySet.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json */ /** - * Sample code: DeleteAvailabilitySet. - * + * Sample code: CreateCloud - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void deleteAvailabilitySet(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.availabilitySets().delete("testrg", "HRAvailabilitySet", null, Context.NONE); + public static void createCloudGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().define("-").withRegion((String) null).withExistingResourceGroup("rgscvmm").withExtendedLocation((ExtendedLocation) null).create(); } } ``` -### AvailabilitySets_GetByResourceGroup +### Clouds_Delete ```java -import com.azure.core.util.Context; - -/** Samples for AvailabilitySets GetByResourceGroup. */ -public final class AvailabilitySetsGetByResourceGroupSamples { +/** + * Samples for Clouds Delete. + */ +public final class CloudsDeleteSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetAvailabilitySet.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MinimumSet_Gen.json */ /** - * Sample code: GetAvailabilitySet. - * + * Sample code: DeleteCloud - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void getAvailabilitySet(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.availabilitySets().getByResourceGroupWithResponse("testrg", "HRAvailabilitySet", Context.NONE); + public static void deleteCloudGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().delete("rgscvmm", ".", null, com.azure.core.util.Context.NONE); } -} -``` - -### AvailabilitySets_List -```java -import com.azure.core.util.Context; - -/** Samples for AvailabilitySets List. */ -public final class AvailabilitySetsListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListAvailabilitySetsBySubscription.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json */ /** - * Sample code: ListAvailabilitySetsBySubscription. - * + * Sample code: DeleteCloud - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listAvailabilitySetsBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.availabilitySets().list(Context.NONE); + public static void deleteCloudGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().delete("rgscvmm", "2", false, com.azure.core.util.Context.NONE); } } ``` -### AvailabilitySets_ListByResourceGroup +### Clouds_GetByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for AvailabilitySets ListByResourceGroup. */ -public final class AvailabilitySetsListByResourceGroupSamples { +/** + * Samples for Clouds GetByResourceGroup. + */ +public final class CloudsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListAvailabilitySetsByResourceGroup.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json */ /** - * Sample code: ListAvailabilitySetsByResourceGroup. - * + * Sample code: GetCloud - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listAvailabilitySetsByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.availabilitySets().listByResourceGroup("testrg", Context.NONE); + public static void getCloudGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().getByResourceGroupWithResponse("rgscvmm", ".", com.azure.core.util.Context.NONE); } -} -``` - -### AvailabilitySets_Update - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.AvailabilitySet; -import java.util.HashMap; -import java.util.Map; -/** Samples for AvailabilitySets Update. */ -public final class AvailabilitySetsUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateAvailabilitySet.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MinimumSet_Gen.json */ /** - * Sample code: UpdateAvailabilitySet. - * + * Sample code: GetCloud - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void updateAvailabilitySet(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - AvailabilitySet resource = - manager - .availabilitySets() - .getByResourceGroupWithResponse("testrg", "HRAvailabilitySet", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void getCloudGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().getByResourceGroupWithResponse("rgscvmm", ".", com.azure.core.util.Context.NONE); } } ``` -### Clouds_CreateOrUpdate - -```java -import com.azure.resourcemanager.scvmm.models.ExtendedLocation; - -/** Samples for Clouds CreateOrUpdate. */ -public final class CloudsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateCloud.json - */ - /** - * Sample code: CreateCloud. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createCloud(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .clouds() - .define("HRCloud") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withUuid("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer") - .create(); - } -} -``` - -### Clouds_Delete +### Clouds_List ```java -import com.azure.core.util.Context; - -/** Samples for Clouds Delete. */ -public final class CloudsDeleteSamples { +/** + * Samples for Clouds List. + */ +public final class CloudsListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteCloud.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MinimumSet_Gen.json */ /** - * Sample code: DeleteCloud. - * + * Sample code: ListCloudsBySubscription - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void deleteCloud(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.clouds().delete("testrg", "HRCloud", null, Context.NONE); + public static void listCloudsBySubscriptionGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().list(com.azure.core.util.Context.NONE); } -} -``` - -### Clouds_GetByResourceGroup - -```java -import com.azure.core.util.Context; -/** Samples for Clouds GetByResourceGroup. */ -public final class CloudsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetCloud.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json */ /** - * Sample code: GetCloud. - * + * Sample code: ListCloudsBySubscription - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void getCloud(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.clouds().getByResourceGroupWithResponse("testrg", "HRCloud", Context.NONE); + public static void listCloudsBySubscriptionGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().list(com.azure.core.util.Context.NONE); } } ``` -### Clouds_List +### Clouds_ListByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for Clouds List. */ -public final class CloudsListSamples { +/** + * Samples for Clouds ListByResourceGroup. + */ +public final class CloudsListByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListCloudsBySubscription.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MinimumSet_Gen.json */ /** - * Sample code: ListCloudsBySubscription. - * + * Sample code: ListCloudsByResourceGroup - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listCloudsBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.clouds().list(Context.NONE); + public static void listCloudsByResourceGroupGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().listByResourceGroup("rgscvmm", com.azure.core.util.Context.NONE); } -} -``` - -### Clouds_ListByResourceGroup - -```java -import com.azure.core.util.Context; -/** Samples for Clouds ListByResourceGroup. */ -public final class CloudsListByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListCloudsByResourceGroup.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json */ /** - * Sample code: ListCloudsByResourceGroup. - * + * Sample code: ListCloudsByResourceGroup - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listCloudsByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.clouds().listByResourceGroup("testrg", Context.NONE); + public static void listCloudsByResourceGroupGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().listByResourceGroup("rgscvmm", com.azure.core.util.Context.NONE); } } ``` @@ -350,125 +197,36 @@ public final class CloudsListByResourceGroupSamples { ### Clouds_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.models.Cloud; -import java.util.HashMap; -import java.util.Map; -/** Samples for Clouds Update. */ +/** + * Samples for Clouds Update. + */ public final class CloudsUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateCloud.json - */ - /** - * Sample code: UpdateCloud. - * - * @param manager Entry point to ScvmmManager. - */ - public static void updateCloud(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - Cloud resource = manager.clouds().getByResourceGroupWithResponse("testrg", "HRCloud", Context.NONE).getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @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; - } -} -``` - -### InventoryItems_Create - -```java -/** Samples for InventoryItems Create. */ -public final class InventoryItemsCreateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateInventoryItem.json - */ - /** - * Sample code: CreateInventoryItem. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createInventoryItem(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .inventoryItems() - .define("12345678-1234-1234-1234-123456789abc") - .withExistingVmmServer("testrg", "ContosoVMMServer") - .create(); - } -} -``` - -### InventoryItems_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for InventoryItems Delete. */ -public final class InventoryItemsDeleteSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteInventoryItem.json - */ - /** - * Sample code: DeleteInventoryItem. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteInventoryItem(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .inventoryItems() - .deleteWithResponse("testrg", "ContosoVMMServer", "12345678-1234-1234-1234-123456789abc", Context.NONE); - } -} -``` - -### InventoryItems_Get - -```java -import com.azure.core.util.Context; - -/** Samples for InventoryItems Get. */ -public final class InventoryItemsGetSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetInventoryItem.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json */ /** - * Sample code: GetInventoryItem. - * + * Sample code: UpdateCloud - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void getInventoryItem(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .inventoryItems() - .getWithResponse("testrg", "ContosoVMMServer", "12345678-1234-1234-1234-123456789abc", Context.NONE); + public static void updateCloudGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + Cloud resource = manager.clouds().getByResourceGroupWithResponse("rgscvmm", "b", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); } -} -``` -### InventoryItems_ListByVmmServer - -```java -import com.azure.core.util.Context; - -/** Samples for InventoryItems ListByVmmServer. */ -public final class InventoryItemsListByVmmServerSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListInventoryItemsByVMMServer.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MinimumSet_Gen.json */ /** - * Sample code: InventoryItemsListByVMMServer. - * + * Sample code: UpdateCloud - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void inventoryItemsListByVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.inventoryItems().listByVmmServer("testrg", "ContosoVMMServer", Context.NONE); + public static void updateCloudGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + Cloud resource = manager.clouds().getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); } } ``` @@ -476,828 +234,292 @@ public final class InventoryItemsListByVmmServerSamples { ### Operations_List ```java -import com.azure.core.util.Context; - -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListOperations.json - */ - /** - * Sample code: ListOperations. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listOperations(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.operations().list(Context.NONE); - } -} -``` - -### VirtualMachineTemplates_CreateOrUpdate - -```java -import com.azure.resourcemanager.scvmm.models.ExtendedLocation; - -/** Samples for VirtualMachineTemplates CreateOrUpdate. */ -public final class VirtualMachineTemplatesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualMachineTemplate.json - */ - /** - * Sample code: CreateVirtualMachineTemplate. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachineTemplates() - .define("HRVirtualMachineTemplate") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withUuid("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer") - .create(); - } -} -``` - -### VirtualMachineTemplates_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates Delete. */ -public final class VirtualMachineTemplatesDeleteSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualMachineTemplate.json - */ - /** - * Sample code: DeleteVirtualMachineTemplate. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachineTemplates().delete("testrg", "HRVirtualMachineTemplate", null, Context.NONE); - } -} -``` - -### VirtualMachineTemplates_GetByResourceGroup - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates GetByResourceGroup. */ -public final class VirtualMachineTemplatesGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualMachineTemplate.json - */ - /** - * Sample code: GetVirtualMachineTemplate. - * - * @param manager Entry point to ScvmmManager. - */ - public static void getVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachineTemplates() - .getByResourceGroupWithResponse("testrg", "HRVirtualMachineTemplate", Context.NONE); - } -} -``` - -### VirtualMachineTemplates_List - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates List. */ -public final class VirtualMachineTemplatesListSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachineTemplatesBySubscription.json - */ - /** - * Sample code: ListVirtualMachineTemplatesBySubscription. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualMachineTemplatesBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachineTemplates().list(Context.NONE); - } -} -``` - -### VirtualMachineTemplates_ListByResourceGroup - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates ListByResourceGroup. */ -public final class VirtualMachineTemplatesListByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json - */ - /** - * Sample code: ListVirtualMachineTemplatesByResourceGroup. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualMachineTemplatesByResourceGroup( - com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachineTemplates().listByResourceGroup("testrg", Context.NONE); - } -} -``` - -### VirtualMachineTemplates_Update - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplate; -import java.util.HashMap; -import java.util.Map; - -/** Samples for VirtualMachineTemplates Update. */ -public final class VirtualMachineTemplatesUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualMachineTemplate.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MinimumSet_Gen.json */ /** - * Sample code: UpdateVirtualMachineTemplate. - * + * Sample code: ListOperations - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void updateVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - VirtualMachineTemplate resource = - manager - .virtualMachineTemplates() - .getByResourceGroupWithResponse("testrg", "HRVirtualMachineTemplate", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void listOperationsGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } -} -``` -### VirtualMachines_CreateCheckpoint - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; - -/** Samples for VirtualMachines CreateCheckpoint. */ -public final class VirtualMachinesCreateCheckpointSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateCheckpointVirtualMachine.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json */ /** - * Sample code: CreateCheckpointVirtualMachine. - * + * Sample code: ListOperations - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void createCheckpointVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .createCheckpoint( - "testrg", - "DemoVM", - new VirtualMachineCreateCheckpoint() - .withName("Demo Checkpoint name") - .withDescription("Demo Checkpoint description"), - Context.NONE); + public static void listOperationsGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### VirtualMachines_CreateOrUpdate +### VirtualNetworks_CreateOrUpdate ```java import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.HardwareProfile; - -/** Samples for VirtualMachines CreateOrUpdate. */ -public final class VirtualMachinesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualMachine.json - */ - /** - * Sample code: CreateVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .define("DemoVM") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer") - .withCloudId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud") - .withTemplateId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate") - .withHardwareProfile(new HardwareProfile().withMemoryMB(4096).withCpuCount(4)) - .create(); - } -} -``` - -### VirtualMachines_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Delete. */ -public final class VirtualMachinesDeleteSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualMachine.json - */ - /** - * Sample code: DeleteVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().delete("testrg", "DemoVM", null, null, Context.NONE); - } -} -``` - -### VirtualMachines_DeleteCheckpoint - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; - -/** Samples for VirtualMachines DeleteCheckpoint. */ -public final class VirtualMachinesDeleteCheckpointSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteCheckpointVirtualMachine.json - */ - /** - * Sample code: DeleteCheckpointVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteCheckpointVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .deleteCheckpoint( - "testrg", "DemoVM", new VirtualMachineDeleteCheckpoint().withId("Demo CheckpointID"), Context.NONE); - } -} -``` - -### VirtualMachines_GetByResourceGroup - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines GetByResourceGroup. */ -public final class VirtualMachinesGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualMachine.json - */ - /** - * Sample code: GetVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void getVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().getByResourceGroupWithResponse("testrg", "DemoVM", Context.NONE); - } -} -``` - -### VirtualMachines_List - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines List. */ -public final class VirtualMachinesListSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachinesBySubscription.json - */ - /** - * Sample code: ListVirtualMachinesBySubscription. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualMachinesBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().list(Context.NONE); - } -} -``` - -### VirtualMachines_ListByResourceGroup - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines ListByResourceGroup. */ -public final class VirtualMachinesListByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachinesByResourceGroup.json - */ - /** - * Sample code: ListVirtualMachinesByResourceGroup. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualMachinesByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().listByResourceGroup("testrg", Context.NONE); - } -} -``` - -### VirtualMachines_Restart - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Restart. */ -public final class VirtualMachinesRestartSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/RestartVirtualMachine.json - */ - /** - * Sample code: RestartVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void restartVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().restart("testrg", "DemoVM", Context.NONE); - } -} -``` - -### VirtualMachines_RestoreCheckpoint - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; - -/** Samples for VirtualMachines RestoreCheckpoint. */ -public final class VirtualMachinesRestoreCheckpointSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/RestoreCheckpointVirtualMachine.json - */ - /** - * Sample code: RestoreCheckpointVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void restoreCheckpointVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .restoreCheckpoint( - "testrg", "DemoVM", new VirtualMachineRestoreCheckpoint().withId("Demo CheckpointID"), Context.NONE); - } -} -``` - -### VirtualMachines_Start - -```java -import com.azure.core.util.Context; -/** Samples for VirtualMachines Start. */ -public final class VirtualMachinesStartSamples { +/** + * Samples for VirtualNetworks CreateOrUpdate. + */ +public final class VirtualNetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/StartVirtualMachine.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json */ /** - * Sample code: StartVirtualMachine. - * + * Sample code: CreateVirtualNetwork - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void startVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().start("testrg", "DemoVM", Context.NONE); + public static void createVirtualNetworkGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.virtualNetworks().define("j").withRegion((String) null).withExistingResourceGroup("rgscvmm").withExtendedLocation((ExtendedLocation) null).create(); } } ``` -### VirtualMachines_Stop +### VirtualNetworks_GetByResourceGroup ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; - -/** Samples for VirtualMachines Stop. */ -public final class VirtualMachinesStopSamples { +/** + * Samples for VirtualNetworks GetByResourceGroup. + */ +public final class VirtualNetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/StopVirtualMachine.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json */ /** - * Sample code: StopVirtualMachine. - * + * Sample code: GetVirtualNetwork - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void stopVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .stop("testrg", "DemoVM", new StopVirtualMachineOptions().withSkipShutdown(true), Context.NONE); + public static void getVirtualNetworkGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.virtualNetworks().getByResourceGroupWithResponse("rgscvmm", "s", com.azure.core.util.Context.NONE); } -} -``` - -### VirtualMachines_Update - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.AllocationMethod; -import com.azure.resourcemanager.scvmm.models.HardwareProfileUpdate; -import com.azure.resourcemanager.scvmm.models.NetworkInterfacesUpdate; -import com.azure.resourcemanager.scvmm.models.NetworkProfileUpdate; -import com.azure.resourcemanager.scvmm.models.StorageProfileUpdate; -import com.azure.resourcemanager.scvmm.models.VirtualDiskUpdate; -import com.azure.resourcemanager.scvmm.models.VirtualMachine; -import com.azure.resourcemanager.scvmm.models.VirtualMachineUpdateProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -/** Samples for VirtualMachines Update. */ -public final class VirtualMachinesUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualMachine.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MinimumSet_Gen.json */ /** - * Sample code: UpdateVirtualMachine. - * + * Sample code: GetVirtualNetwork - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void updateVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - VirtualMachine resource = - manager.virtualMachines().getByResourceGroupWithResponse("testrg", "DemoVM", Context.NONE).getValue(); - resource - .update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withProperties( - new VirtualMachineUpdateProperties() - .withHardwareProfile(new HardwareProfileUpdate().withMemoryMB(4096).withCpuCount(4)) - .withStorageProfile( - new StorageProfileUpdate() - .withDisks(Arrays.asList(new VirtualDiskUpdate().withName("test").withDiskSizeGB(10)))) - .withNetworkProfile( - new NetworkProfileUpdate() - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfacesUpdate() - .withName("test") - .withIpv4AddressType(AllocationMethod.DYNAMIC) - .withIpv6AddressType(AllocationMethod.DYNAMIC) - .withMacAddressType(AllocationMethod.STATIC))))) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void getVirtualNetworkGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.virtualNetworks().getByResourceGroupWithResponse("rgscvmm", "_", com.azure.core.util.Context.NONE); } } ``` -### VirtualNetworks_CreateOrUpdate +### VmmServers_CreateOrUpdate ```java import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -/** Samples for VirtualNetworks CreateOrUpdate. */ -public final class VirtualNetworksCreateOrUpdateSamples { +/** + * Samples for VmmServers CreateOrUpdate. + */ +public final class VmmServersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualNetwork.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MinimumSet_Gen.json */ /** - * Sample code: CreateVirtualNetwork. - * + * Sample code: CreateVMMServer - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void createVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualNetworks() - .define("HRVirtualNetwork") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withUuid("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer") - .create(); + public static void createVMMServerGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().define("h").withRegion((String) null).withExistingResourceGroup("rgscvmm").withExtendedLocation((ExtendedLocation) null).create(); } -} -``` -### VirtualNetworks_Delete - -```java -import com.azure.core.util.Context; - -/** Samples for VirtualNetworks Delete. */ -public final class VirtualNetworksDeleteSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualNetwork.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json */ /** - * Sample code: DeleteVirtualNetwork. - * + * Sample code: CreateVMMServer - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void deleteVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualNetworks().delete("testrg", "HRVirtualNetwork", null, Context.NONE); + public static void createVMMServerGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().define("b").withRegion((String) null).withExistingResourceGroup("rgscvmm").withExtendedLocation((ExtendedLocation) null).create(); } } ``` -### VirtualNetworks_GetByResourceGroup +### VmmServers_Delete ```java -import com.azure.core.util.Context; - -/** Samples for VirtualNetworks GetByResourceGroup. */ -public final class VirtualNetworksGetByResourceGroupSamples { +/** + * Samples for VmmServers Delete. + */ +public final class VmmServersDeleteSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualNetwork.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json */ /** - * Sample code: GetVirtualNetwork. - * + * Sample code: DeleteVMMServer - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void getVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualNetworks().getByResourceGroupWithResponse("testrg", "HRVirtualNetwork", Context.NONE); + public static void deleteVMMServerGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().delete("rgscvmm", "-", false, com.azure.core.util.Context.NONE); } -} -``` - -### VirtualNetworks_List -```java -import com.azure.core.util.Context; - -/** Samples for VirtualNetworks List. */ -public final class VirtualNetworksListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualNetworksBySubscription.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MinimumSet_Gen.json */ /** - * Sample code: ListVirtualNetworksBySubscription. - * + * Sample code: DeleteVMMServer - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listVirtualNetworksBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualNetworks().list(Context.NONE); + public static void deleteVMMServerGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().delete("rgscvmm", "-", null, com.azure.core.util.Context.NONE); } } ``` -### VirtualNetworks_ListByResourceGroup +### VmmServers_GetByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for VirtualNetworks ListByResourceGroup. */ -public final class VirtualNetworksListByResourceGroupSamples { +/** + * Samples for VmmServers GetByResourceGroup. + */ +public final class VmmServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualNetworksByResourceGroup.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MinimumSet_Gen.json */ /** - * Sample code: ListVirtualNetworksByResourceGroup. - * + * Sample code: GetVMMServer - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listVirtualNetworksByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualNetworks().listByResourceGroup("testrg", Context.NONE); + public static void getVMMServerGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE); } -} -``` - -### VirtualNetworks_Update - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualNetwork; -import java.util.HashMap; -import java.util.Map; -/** Samples for VirtualNetworks Update. */ -public final class VirtualNetworksUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualNetwork.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json */ /** - * Sample code: UpdateVirtualNetwork. - * + * Sample code: GetVMMServer - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void updateVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - VirtualNetwork resource = - manager - .virtualNetworks() - .getByResourceGroupWithResponse("testrg", "HRVirtualNetwork", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void getVMMServerGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE); } } ``` -### VmmServers_CreateOrUpdate +### VmmServers_List ```java -import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.VmmServerPropertiesCredentials; - -/** Samples for VmmServers CreateOrUpdate. */ -public final class VmmServersCreateOrUpdateSamples { +/** + * Samples for VmmServers List. + */ +public final class VmmServersListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVMMServer.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MinimumSet_Gen.json */ /** - * Sample code: CreateVMMServer. - * + * Sample code: ListVmmServersBySubscription - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void createVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .vmmServers() - .define("ContosoVMMServer") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withFqdn("VMM.contoso.com") - .withCredentials(new VmmServerPropertiesCredentials().withUsername("testuser").withPassword("password")) - .withPort(1234) - .create(); + public static void listVmmServersBySubscriptionGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().list(com.azure.core.util.Context.NONE); } -} -``` - -### VmmServers_Delete - -```java -import com.azure.core.util.Context; -/** Samples for VmmServers Delete. */ -public final class VmmServersDeleteSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVMMServer.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json */ /** - * Sample code: DeleteVMMServer. - * + * Sample code: ListVmmServersBySubscription - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void deleteVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.vmmServers().delete("testrg", "ContosoVMMServer", null, Context.NONE); + public static void listVmmServersBySubscriptionGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().list(com.azure.core.util.Context.NONE); } } ``` -### VmmServers_GetByResourceGroup +### VmmServers_ListByResourceGroup ```java -import com.azure.core.util.Context; - -/** Samples for VmmServers GetByResourceGroup. */ -public final class VmmServersGetByResourceGroupSamples { +/** + * Samples for VmmServers ListByResourceGroup. + */ +public final class VmmServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVMMServer.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json */ /** - * Sample code: GetVMMServer. - * + * Sample code: ListVmmServersByResourceGroup - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void getVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.vmmServers().getByResourceGroupWithResponse("testrg", "ContosoVMMServer", Context.NONE); + public static void listVmmServersByResourceGroupGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().listByResourceGroup("rgscvmm", com.azure.core.util.Context.NONE); } -} -``` - -### VmmServers_List - -```java -import com.azure.core.util.Context; -/** Samples for VmmServers List. */ -public final class VmmServersListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVMMServersBySubscription.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MinimumSet_Gen.json */ /** - * Sample code: ListVmmServersBySubscription. - * + * Sample code: ListVmmServersByResourceGroup - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listVmmServersBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.vmmServers().list(Context.NONE); + public static void listVmmServersByResourceGroupGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().listByResourceGroup("rgscvmm", com.azure.core.util.Context.NONE); } } ``` -### VmmServers_ListByResourceGroup +### VmmServers_Update ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.scvmm.models.VmmServer; -/** Samples for VmmServers ListByResourceGroup. */ -public final class VmmServersListByResourceGroupSamples { +/** + * Samples for VmmServers Update. + */ +public final class VmmServersUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVMMServersByResourceGroup.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json */ /** - * Sample code: ListVmmServersByResourceGroup. - * + * Sample code: UpdateVMMServer - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listVmmServersByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.vmmServers().listByResourceGroup("testrg", Context.NONE); + public static void updateVMMServerGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + VmmServer resource = manager.vmmServers().getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); } -} -``` -### VmmServers_Update - -```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VmmServer; -import java.util.HashMap; -import java.util.Map; - -/** Samples for VmmServers Update. */ -public final class VmmServersUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVMMServer.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MinimumSet_Gen.json */ /** - * Sample code: UpdateVMMServer. - * + * Sample code: UpdateVMMServer - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void updateVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - VmmServer resource = - manager.vmmServers().getByResourceGroupWithResponse("testrg", "ContosoVMMServer", Context.NONE).getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void updateVMMServerGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + VmmServer resource = manager.vmmServers().getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); } } ``` diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/pom.xml b/sdk/scvmm/azure-resourcemanager-scvmm/pom.xml index efdbdff58699a..f8807b660c333 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/pom.xml +++ b/sdk/scvmm/azure-resourcemanager-scvmm/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for Scvmm Management - This package contains Microsoft Azure SDK for Scvmm Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. SCVMM Client. Package tag package-2020-06-05-preview. + This package contains Microsoft Azure SDK for Scvmm Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. SCVMM Client. Package tag package-2023-10. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/ScvmmManager.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/ScvmmManager.java index 4a2dfdf09f07b..4c3158a4581f7 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/ScvmmManager.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/ScvmmManager.java @@ -26,20 +26,24 @@ import com.azure.resourcemanager.scvmm.fluent.ScvmmClient; import com.azure.resourcemanager.scvmm.implementation.AvailabilitySetsImpl; import com.azure.resourcemanager.scvmm.implementation.CloudsImpl; +import com.azure.resourcemanager.scvmm.implementation.GuestAgentsImpl; import com.azure.resourcemanager.scvmm.implementation.InventoryItemsImpl; import com.azure.resourcemanager.scvmm.implementation.OperationsImpl; import com.azure.resourcemanager.scvmm.implementation.ScvmmClientBuilder; +import com.azure.resourcemanager.scvmm.implementation.VirtualMachineInstancesImpl; import com.azure.resourcemanager.scvmm.implementation.VirtualMachineTemplatesImpl; -import com.azure.resourcemanager.scvmm.implementation.VirtualMachinesImpl; import com.azure.resourcemanager.scvmm.implementation.VirtualNetworksImpl; +import com.azure.resourcemanager.scvmm.implementation.VmInstanceHybridIdentityMetadatasImpl; import com.azure.resourcemanager.scvmm.implementation.VmmServersImpl; import com.azure.resourcemanager.scvmm.models.AvailabilitySets; import com.azure.resourcemanager.scvmm.models.Clouds; +import com.azure.resourcemanager.scvmm.models.GuestAgents; import com.azure.resourcemanager.scvmm.models.InventoryItems; import com.azure.resourcemanager.scvmm.models.Operations; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstances; import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplates; -import com.azure.resourcemanager.scvmm.models.VirtualMachines; import com.azure.resourcemanager.scvmm.models.VirtualNetworks; +import com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadatas; import com.azure.resourcemanager.scvmm.models.VmmServers; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -48,21 +52,28 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to ScvmmManager. SCVMM Client. */ +/** + * Entry point to ScvmmManager. + * SCVMM Client. + */ public final class ScvmmManager { - private VmmServers vmmServers; + private VirtualMachineInstances virtualMachineInstances; - private Operations operations; + private GuestAgents guestAgents; - private Clouds clouds; + private VmInstanceHybridIdentityMetadatas vmInstanceHybridIdentityMetadatas; - private VirtualNetworks virtualNetworks; + private Operations operations; - private VirtualMachines virtualMachines; + private AvailabilitySets availabilitySets; + + private Clouds clouds; private VirtualMachineTemplates virtualMachineTemplates; - private AvailabilitySets availabilitySets; + private VirtualNetworks virtualNetworks; + + private VmmServers vmmServers; private InventoryItems inventoryItems; @@ -71,18 +82,14 @@ public final class ScvmmManager { private ScvmmManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new ScvmmClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new ScvmmClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval).buildClient(); } /** * Creates an instance of Scvmm service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the Scvmm service API instance. @@ -95,7 +102,7 @@ public static ScvmmManager authenticate(TokenCredential credential, AzureProfile /** * Creates an instance of Scvmm service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the Scvmm service API instance. @@ -108,14 +115,16 @@ public static ScvmmManager authenticate(HttpPipeline httpPipeline, AzureProfile /** * Gets a Configurable instance that can be used to create ScvmmManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new ScvmmManager.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); @@ -187,8 +196,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. @@ -205,8 +214,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -226,21 +235,12 @@ public ScvmmManager authenticate(TokenCredential credential, AzureProfile profil Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.scvmm") - .append("/") + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.scvmm").append("/") .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); + userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -259,50 +259,63 @@ public ScvmmManager authenticate(TokenCredential credential, AzureProfile profil policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); return new ScvmmManager(httpPipeline, profile, defaultPollInterval); } } /** - * Gets the resource collection API of VmmServers. - * - * @return Resource collection API of VmmServers. + * Gets the resource collection API of VirtualMachineInstances. + * + * @return Resource collection API of VirtualMachineInstances. */ - public VmmServers vmmServers() { - if (this.vmmServers == null) { - this.vmmServers = new VmmServersImpl(clientObject.getVmmServers(), this); + public VirtualMachineInstances virtualMachineInstances() { + if (this.virtualMachineInstances == null) { + this.virtualMachineInstances + = new VirtualMachineInstancesImpl(clientObject.getVirtualMachineInstances(), this); } - return vmmServers; + return virtualMachineInstances; + } + + /** + * Gets the resource collection API of GuestAgents. + * + * @return Resource collection API of GuestAgents. + */ + public GuestAgents guestAgents() { + if (this.guestAgents == null) { + this.guestAgents = new GuestAgentsImpl(clientObject.getGuestAgents(), this); + } + return guestAgents; + } + + /** + * Gets the resource collection API of VmInstanceHybridIdentityMetadatas. + * + * @return Resource collection API of VmInstanceHybridIdentityMetadatas. + */ + public VmInstanceHybridIdentityMetadatas vmInstanceHybridIdentityMetadatas() { + if (this.vmInstanceHybridIdentityMetadatas == null) { + this.vmInstanceHybridIdentityMetadatas + = new VmInstanceHybridIdentityMetadatasImpl(clientObject.getVmInstanceHybridIdentityMetadatas(), this); + } + return vmInstanceHybridIdentityMetadatas; } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -313,69 +326,69 @@ public Operations operations() { } /** - * Gets the resource collection API of Clouds. - * - * @return Resource collection API of Clouds. + * Gets the resource collection API of AvailabilitySets. It manages AvailabilitySet. + * + * @return Resource collection API of AvailabilitySets. */ - public Clouds clouds() { - if (this.clouds == null) { - this.clouds = new CloudsImpl(clientObject.getClouds(), this); + public AvailabilitySets availabilitySets() { + if (this.availabilitySets == null) { + this.availabilitySets = new AvailabilitySetsImpl(clientObject.getAvailabilitySets(), this); } - return clouds; + return availabilitySets; } /** - * Gets the resource collection API of VirtualNetworks. - * - * @return Resource collection API of VirtualNetworks. + * Gets the resource collection API of Clouds. It manages Cloud. + * + * @return Resource collection API of Clouds. */ - public VirtualNetworks virtualNetworks() { - if (this.virtualNetworks == null) { - this.virtualNetworks = new VirtualNetworksImpl(clientObject.getVirtualNetworks(), this); + public Clouds clouds() { + if (this.clouds == null) { + this.clouds = new CloudsImpl(clientObject.getClouds(), this); } - return virtualNetworks; + return clouds; } /** - * Gets the resource collection API of VirtualMachines. - * - * @return Resource collection API of VirtualMachines. + * Gets the resource collection API of VirtualMachineTemplates. It manages VirtualMachineTemplate. + * + * @return Resource collection API of VirtualMachineTemplates. */ - public VirtualMachines virtualMachines() { - if (this.virtualMachines == null) { - this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); + public VirtualMachineTemplates virtualMachineTemplates() { + if (this.virtualMachineTemplates == null) { + this.virtualMachineTemplates + = new VirtualMachineTemplatesImpl(clientObject.getVirtualMachineTemplates(), this); } - return virtualMachines; + return virtualMachineTemplates; } /** - * Gets the resource collection API of VirtualMachineTemplates. - * - * @return Resource collection API of VirtualMachineTemplates. + * Gets the resource collection API of VirtualNetworks. It manages VirtualNetwork. + * + * @return Resource collection API of VirtualNetworks. */ - public VirtualMachineTemplates virtualMachineTemplates() { - if (this.virtualMachineTemplates == null) { - this.virtualMachineTemplates = - new VirtualMachineTemplatesImpl(clientObject.getVirtualMachineTemplates(), this); + public VirtualNetworks virtualNetworks() { + if (this.virtualNetworks == null) { + this.virtualNetworks = new VirtualNetworksImpl(clientObject.getVirtualNetworks(), this); } - return virtualMachineTemplates; + return virtualNetworks; } /** - * Gets the resource collection API of AvailabilitySets. - * - * @return Resource collection API of AvailabilitySets. + * Gets the resource collection API of VmmServers. It manages VmmServer. + * + * @return Resource collection API of VmmServers. */ - public AvailabilitySets availabilitySets() { - if (this.availabilitySets == null) { - this.availabilitySets = new AvailabilitySetsImpl(clientObject.getAvailabilitySets(), this); + public VmmServers vmmServers() { + if (this.vmmServers == null) { + this.vmmServers = new VmmServersImpl(clientObject.getVmmServers(), this); } - return availabilitySets; + return vmmServers; } /** - * Gets the resource collection API of InventoryItems. - * + * Gets the resource collection API of InventoryItems. It manages InventoryItem. + * * @return Resource collection API of InventoryItems. */ public InventoryItems inventoryItems() { @@ -386,8 +399,10 @@ public InventoryItems inventoryItems() { } /** - * @return Wrapped service client ScvmmClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets wrapped service client ScvmmClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client ScvmmClient. */ public ScvmmClient serviceClient() { return this.clientObject; diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/AvailabilitySetsClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/AvailabilitySetsClient.java index 41a0d72042414..2287ce0519928 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/AvailabilitySetsClient.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/AvailabilitySetsClient.java @@ -12,194 +12,170 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.scvmm.fluent.models.AvailabilitySetInner; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; +import com.azure.resourcemanager.scvmm.models.AvailabilitySetTagsUpdate; -/** An instance of this class provides access to all the operations defined in AvailabilitySetsClient. */ +/** + * An instance of this class provides access to all the operations defined in AvailabilitySetsClient. + */ public interface AvailabilitySetsClient { /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of AvailabilitySets in a 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 the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * List of AvailabilitySets in a 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 the AvailabilitySets resource definition along with {@link Response}. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String availabilitySetName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * List of AvailabilitySets in a 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 the {@link SyncPoller} for polling of the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AvailabilitySetInner> beginCreateOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * List of AvailabilitySets in a 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 the {@link SyncPoller} for polling of the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AvailabilitySetInner> beginCreateOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @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 AvailabilitySets resource definition. + * @return the AvailabilitySets resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilitySetInner createOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body); + Response getByResourceGroupWithResponse(String resourceGroupName, + String availabilitySetResourceName, Context context); /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. - * @param context The context to associate with this operation. + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilitySetInner createOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body, Context context); + AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetResourceName); /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String availabilitySetName, Boolean force); + SyncPoller, AvailabilitySetInner> beginCreateOrUpdate(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetInner resource); /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @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 AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String availabilitySetName, Boolean force, Context context); - - /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String availabilitySetName, Boolean force); + SyncPoller, AvailabilitySetInner> beginCreateOrUpdate(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetInner resource, Context context); /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String availabilitySetName); + AvailabilitySetInner createOrUpdate(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetInner resource); /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @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 AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String availabilitySetName, Boolean force, Context context); + AvailabilitySetInner createOrUpdate(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetInner resource, Context context); /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AvailabilitySetInner> beginUpdate( - String resourceGroupName, String availabilitySetName, ResourcePatch body); + SyncPoller, AvailabilitySetInner> beginUpdate(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetTagsUpdate properties); /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @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. @@ -207,29 +183,30 @@ SyncPoller, AvailabilitySetInner> beginUpdate( * @return the {@link SyncPoller} for polling of the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AvailabilitySetInner> beginUpdate( - String resourceGroupName, String availabilitySetName, ResourcePatch body, Context context); + SyncPoller, AvailabilitySetInner> beginUpdate(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetTagsUpdate properties, Context context); /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilitySetInner update(String resourceGroupName, String availabilitySetName, ResourcePatch body); + AvailabilitySetInner update(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetTagsUpdate properties); /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @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. @@ -237,53 +214,61 @@ SyncPoller, AvailabilitySetInner> beginUpdate( * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - AvailabilitySetInner update( - String resourceGroupName, String availabilitySetName, ResourcePatch body, Context context); + AvailabilitySetInner update(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetTagsUpdate properties, Context context); /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String availabilitySetResourceName); /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @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 list of AvailabilitySets as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String availabilitySetResourceName, + Boolean force, Context context); /** - * List of AvailabilitySets in a subscription. - * + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String availabilitySetResourceName); /** - * List of AvailabilitySets in a subscription. - * + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @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 list of AvailabilitySets as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String availabilitySetResourceName, Boolean force, Context context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/CloudsClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/CloudsClient.java index 6f3236475f18a..6d9f9e3469bff 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/CloudsClient.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/CloudsClient.java @@ -12,191 +12,168 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.scvmm.fluent.models.CloudInner; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; +import com.azure.resourcemanager.scvmm.models.CloudTagsUpdate; -/** An instance of this class provides access to all the operations defined in CloudsClient. */ +/** + * An instance of this class provides access to all the operations defined in CloudsClient. + */ public interface CloudsClient { /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of Clouds in a 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 the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - CloudInner getByResourceGroup(String resourceGroupName, String cloudName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * List of Clouds in a 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 the Clouds resource definition along with {@link Response}. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String cloudName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * List of Clouds in a 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 the {@link SyncPoller} for polling of the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CloudInner> beginCreateOrUpdate( - String resourceGroupName, String cloudName, CloudInner body); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * List of Clouds in a 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 the {@link SyncPoller} for polling of the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CloudInner> beginCreateOrUpdate( - String resourceGroupName, String cloudName, CloudInner body, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @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 Clouds resource definition. + * @return the Clouds resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CloudInner createOrUpdate(String resourceGroupName, String cloudName, CloudInner body); + Response getByResourceGroupWithResponse(String resourceGroupName, String cloudResourceName, + Context context); /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. - * @param context The context to associate with this operation. + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - CloudInner createOrUpdate(String resourceGroupName, String cloudName, CloudInner body, Context context); + CloudInner getByResourceGroup(String resourceGroupName, String cloudResourceName); /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String cloudName, Boolean force); + SyncPoller, CloudInner> beginCreateOrUpdate(String resourceGroupName, + String cloudResourceName, CloudInner resource); /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @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 Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String cloudName, Boolean force, Context context); - - /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String cloudName, Boolean force); + SyncPoller, CloudInner> beginCreateOrUpdate(String resourceGroupName, + String cloudResourceName, CloudInner resource, Context context); /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String cloudName); + CloudInner createOrUpdate(String resourceGroupName, String cloudResourceName, CloudInner resource); /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @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 Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String cloudName, Boolean force, Context context); + CloudInner createOrUpdate(String resourceGroupName, String cloudResourceName, CloudInner resource, Context context); /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CloudInner> beginUpdate( - String resourceGroupName, String cloudName, ResourcePatch body); + SyncPoller, CloudInner> beginUpdate(String resourceGroupName, String cloudResourceName, + CloudTagsUpdate properties); /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @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. @@ -204,29 +181,29 @@ SyncPoller, CloudInner> beginUpdate( * @return the {@link SyncPoller} for polling of the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CloudInner> beginUpdate( - String resourceGroupName, String cloudName, ResourcePatch body, Context context); + SyncPoller, CloudInner> beginUpdate(String resourceGroupName, String cloudResourceName, + CloudTagsUpdate properties, Context context); /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - CloudInner update(String resourceGroupName, String cloudName, ResourcePatch body); + CloudInner update(String resourceGroupName, String cloudResourceName, CloudTagsUpdate properties); /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @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. @@ -234,52 +211,60 @@ SyncPoller, CloudInner> beginUpdate( * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - CloudInner update(String resourceGroupName, String cloudName, ResourcePatch body, Context context); + CloudInner update(String resourceGroupName, String cloudResourceName, CloudTagsUpdate properties, Context context); /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudResourceName); /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @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 list of Clouds as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudResourceName, Boolean force, + Context context); /** - * List of Clouds in a subscription. - * + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cloudResourceName); /** - * List of Clouds in a subscription. - * + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @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 list of Clouds as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cloudResourceName, Boolean force, Context context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/GuestAgentsClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/GuestAgentsClient.java new file mode 100644 index 0000000000000..a6b16887c2e43 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/GuestAgentsClient.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.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.scvmm.fluent.models.GuestAgentInner; + +/** + * An instance of this class provides access to all the operations defined in GuestAgentsClient. + */ +public interface GuestAgentsClient { + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuestAgent list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualMachineInstance(String resourceUri); + + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 response of a GuestAgent list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualMachineInstance(String resourceUri, Context context); + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 defines the GuestAgent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuestAgentInner get(String resourceUri); + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GuestAgentInner> beginCreate(String resourceUri, GuestAgentInner resource); + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GuestAgentInner> beginCreate(String resourceUri, GuestAgentInner resource, + Context context); + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuestAgentInner create(String resourceUri, GuestAgentInner resource); + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GuestAgentInner create(String resourceUri, GuestAgentInner resource, Context context); + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceUri, Context context); + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/InventoryItemsClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/InventoryItemsClient.java index cb386bca2ecc2..d68e11d7204b8 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/InventoryItemsClient.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/InventoryItemsClient.java @@ -11,29 +11,43 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemInner; -/** An instance of this class provides access to all the operations defined in InventoryItemsClient. */ +/** + * An instance of this class provides access to all the operations defined in InventoryItemsClient. + */ public interface InventoryItemsClient { /** - * Create Or Update InventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item. + * @return the response of a InventoryItem list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - InventoryItemInner create(String resourceGroupName, String vmmServerName, String inventoryItemName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName); /** - * Create Or Update InventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. - * @param body Request payload. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @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 response of a InventoryItem list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName, Context context); + + /** + * Shows an inventory item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @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,33 +55,30 @@ public interface InventoryItemsClient { * @return defines the inventory item along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String vmmServerName, - String inventoryItemName, - InventoryItemInner body, - Context context); + Response getWithResponse(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, Context context); /** * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the inventory item. */ @ServiceMethod(returns = ReturnType.SINGLE) - InventoryItemInner get(String resourceGroupName, String vmmServerName, String inventoryItemName); + InventoryItemInner get(String resourceGroupName, String vmmServerName, String inventoryItemResourceName); /** - * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Create Or Update InventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @param resource Resource create parameters. * @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. @@ -75,28 +86,31 @@ Response createWithResponse( * @return defines the inventory item along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context); + Response createWithResponse(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, InventoryItemInner resource, Context context); /** - * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Create Or Update InventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the inventory item. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmmServerName, String inventoryItemName); + InventoryItemInner create(String resourceGroupName, String vmmServerName, String inventoryItemResourceName, + InventoryItemInner resource); /** * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @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. @@ -104,33 +118,19 @@ Response getWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context); - - /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName); + Response deleteWithResponse(String resourceGroupName, String vmmServerName, String inventoryItemResourceName, + Context context); /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param context The context to associate with this operation. + * Deletes an inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vmmServerName, String inventoryItemResourceName); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/OperationsClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/OperationsClient.java index 36f33fb8ffe24..70b2d088ee3ad 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/OperationsClient.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/OperationsClient.java @@ -8,29 +8,33 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.fluent.models.ResourceProviderOperationInner; +import com.azure.resourcemanager.scvmm.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 { /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @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 results of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/ScvmmClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/ScvmmClient.java index 7d130a42a24bc..03ea68e667bb9 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/ScvmmClient.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/ScvmmClient.java @@ -7,95 +7,111 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for ScvmmClient class. */ +/** + * The interface for ScvmmClient class. + */ public interface ScvmmClient { /** - * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * + * Gets The ID of the target subscription. + * * @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 VmmServersClient object to access its operations. - * - * @return the VmmServersClient object. + * Gets the VirtualMachineInstancesClient object to access its operations. + * + * @return the VirtualMachineInstancesClient object. */ - VmmServersClient getVmmServers(); + VirtualMachineInstancesClient getVirtualMachineInstances(); /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. + * Gets the GuestAgentsClient object to access its operations. + * + * @return the GuestAgentsClient object. */ - OperationsClient getOperations(); + GuestAgentsClient getGuestAgents(); /** - * Gets the CloudsClient object to access its operations. - * - * @return the CloudsClient object. + * Gets the VmInstanceHybridIdentityMetadatasClient object to access its operations. + * + * @return the VmInstanceHybridIdentityMetadatasClient object. */ - CloudsClient getClouds(); + VmInstanceHybridIdentityMetadatasClient getVmInstanceHybridIdentityMetadatas(); /** - * Gets the VirtualNetworksClient object to access its operations. - * - * @return the VirtualNetworksClient object. + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. */ - VirtualNetworksClient getVirtualNetworks(); + OperationsClient getOperations(); + + /** + * Gets the AvailabilitySetsClient object to access its operations. + * + * @return the AvailabilitySetsClient object. + */ + AvailabilitySetsClient getAvailabilitySets(); /** - * Gets the VirtualMachinesClient object to access its operations. - * - * @return the VirtualMachinesClient object. + * Gets the CloudsClient object to access its operations. + * + * @return the CloudsClient object. */ - VirtualMachinesClient getVirtualMachines(); + CloudsClient getClouds(); /** * Gets the VirtualMachineTemplatesClient object to access its operations. - * + * * @return the VirtualMachineTemplatesClient object. */ VirtualMachineTemplatesClient getVirtualMachineTemplates(); /** - * Gets the AvailabilitySetsClient object to access its operations. - * - * @return the AvailabilitySetsClient object. + * Gets the VirtualNetworksClient object to access its operations. + * + * @return the VirtualNetworksClient object. */ - AvailabilitySetsClient getAvailabilitySets(); + VirtualNetworksClient getVirtualNetworks(); + + /** + * Gets the VmmServersClient object to access its operations. + * + * @return the VmmServersClient object. + */ + VmmServersClient getVmmServers(); /** * Gets the InventoryItemsClient object to access its operations. - * + * * @return the InventoryItemsClient object. */ InventoryItemsClient getInventoryItems(); diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachineInstancesClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachineInstancesClient.java new file mode 100644 index 0000000000000..44b971358ba9d --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachineInstancesClient.java @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.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.scvmm.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; +import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; +import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceUpdate; +import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; + +/** + * An instance of this class provides access to all the operations defined in VirtualMachineInstancesClient. + */ +public interface VirtualMachineInstancesClient { + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VirtualMachineInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 response of a VirtualMachineInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 define the virtualMachineInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner get(String resourceUri); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> + beginCreateOrUpdate(String resourceUri, VirtualMachineInstanceInner resource); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> + beginCreateOrUpdate(String resourceUri, VirtualMachineInstanceInner resource, Context context); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner createOrUpdate(String resourceUri, VirtualMachineInstanceInner resource); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner createOrUpdate(String resourceUri, VirtualMachineInstanceInner resource, + Context context); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginUpdate(String resourceUri, + VirtualMachineInstanceUpdate properties); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualMachineInstanceInner> beginUpdate(String resourceUri, + VirtualMachineInstanceUpdate properties, Context context); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner update(String resourceUri, VirtualMachineInstanceUpdate properties); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualMachineInstanceInner update(String resourceUri, VirtualMachineInstanceUpdate properties, Context context); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceUri, Boolean force, Boolean deleteFromHost, + Context context); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceUri, Boolean force, Boolean deleteFromHost, Context context); + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCreateCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body); + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCreateCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body, + Context context); + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void createCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body); + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void createCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body, Context context); + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body); + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body, + Context context); + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body); + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body, Context context); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceUri, Object body); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceUri, Object body, Context context); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceUri, Object body); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceUri, Object body, Context context); + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body); + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body, + Context context); + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body); + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body, Context context); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceUri, Object body); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceUri, Object body, Context context); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceUri, Object body); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceUri, Object body, Context context); + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop(String resourceUri, StopVirtualMachineOptions body); + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop(String resourceUri, StopVirtualMachineOptions body, Context context); + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceUri, StopVirtualMachineOptions body); + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceUri, StopVirtualMachineOptions body, Context context); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachineTemplatesClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachineTemplatesClient.java index 4cb11297666b4..8dcf75e9fe350 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachineTemplatesClient.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachineTemplatesClient.java @@ -12,180 +12,156 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineTemplateInner; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; +import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateTagsUpdate; -/** An instance of this class provides access to all the operations defined in VirtualMachineTemplatesClient. */ +/** + * An instance of this class provides access to all the operations defined in VirtualMachineTemplatesClient. + */ public interface VirtualMachineTemplatesClient { /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VirtualMachineTemplates in a 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 the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * List of VirtualMachineTemplates in a 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 the VirtualMachineTemplates resource definition along with {@link Response}. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineTemplateName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * List of VirtualMachineTemplates in a 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 the {@link SyncPoller} for polling of the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineTemplateInner> beginCreateOrUpdate( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * List of VirtualMachineTemplates in a 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 the {@link SyncPoller} for polling of the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineTemplateInner> beginCreateOrUpdate( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * @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 VirtualMachineTemplates resource definition. + * @return the VirtualMachineTemplates resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineTemplateInner createOrUpdate( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body); + Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualMachineTemplateName, Context context); /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. - * @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 VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineTemplateInner createOrUpdate( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body, Context context); + VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName); /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineTemplateName, Boolean force); + SyncPoller, VirtualMachineTemplateInner> beginCreateOrUpdate( + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner resource); /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @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 VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context); - - /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force); + SyncPoller, VirtualMachineTemplateInner> beginCreateOrUpdate( + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner resource, + Context context); /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineTemplateName); + VirtualMachineTemplateInner createOrUpdate(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateInner resource); /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @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 VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context); + VirtualMachineTemplateInner createOrUpdate(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateInner resource, Context context); /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -193,14 +169,14 @@ SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualMachineTemplateInner> beginUpdate( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body); + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateTagsUpdate properties); /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @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. @@ -209,28 +185,30 @@ SyncPoller, VirtualMachineTemplateInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, VirtualMachineTemplateInner> beginUpdate( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context); + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateTagsUpdate properties, + Context context); /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineTemplateInner update(String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body); + VirtualMachineTemplateInner update(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateTagsUpdate properties); /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @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. @@ -238,53 +216,61 @@ SyncPoller, VirtualMachineTemplateInner> * @return the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineTemplateInner update( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context); + VirtualMachineTemplateInner update(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateTagsUpdate properties, Context context); /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineTemplateName); /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @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 list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineTemplateName, + Boolean force, Context context); /** - * List of VirtualMachineTemplates in a subscription. - * + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualMachineTemplateName); /** - * List of VirtualMachineTemplates in a subscription. - * + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @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 list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachinesClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachinesClient.java deleted file mode 100644 index ea76ff19ba7d8..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualMachinesClient.java +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.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.scvmm.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; -import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineUpdate; - -/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ -public interface VirtualMachinesClient { - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner getByResourceGroup(String resourceGroupName, String virtualMachineName); - - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @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 VirtualMachines resource definition along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineName, Context context); - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body); - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context); - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner createOrUpdate(String resourceGroupName, String virtualMachineName, VirtualMachineInner body); - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner createOrUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, Context context); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineName); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, Context context); - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body); - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context); - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner update(String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body); - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualMachineInner update( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context); - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body); - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStop( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context); - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body); - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String virtualMachineName); - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context); - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String virtualMachineName); - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String virtualMachineName); - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestart(String resourceGroupName, String virtualMachineName); - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestart( - String resourceGroupName, String virtualMachineName, Context context); - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String virtualMachineName); - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCreateCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body); - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCreateCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context); - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void createCheckpoint(String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body); - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void createCheckpoint(String resourceGroupName, String virtualMachineName); - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void createCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteCheckpoint(String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteCheckpoint(String resourceGroupName, String virtualMachineName); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreCheckpoint(String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreCheckpoint(String resourceGroupName, String virtualMachineName); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void restoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context); - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List of VirtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List of VirtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualNetworksClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualNetworksClient.java index ac674ac85490f..b3c2befad8429 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualNetworksClient.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VirtualNetworksClient.java @@ -12,193 +12,170 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.scvmm.fluent.models.VirtualNetworkInner; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; +import com.azure.resourcemanager.scvmm.models.VirtualNetworkTagsUpdate; -/** An instance of this class provides access to all the operations defined in VirtualNetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in VirtualNetworksClient. + */ public interface VirtualNetworksClient { /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VirtualNetworks in a 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 the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. + * List of VirtualNetworks in a 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 the VirtualNetworks resource definition along with {@link Response}. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * List of VirtualNetworks in a 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 the {@link SyncPoller} for polling of the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * List of VirtualNetworks in a 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 the {@link SyncPoller} for polling of the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * @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 VirtualNetworks resource definition. + * @return the VirtualNetworks resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body); + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualNetworkName, + Context context); /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. - * @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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context); + VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName); /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, Boolean force); + SyncPoller, VirtualNetworkInner> beginCreateOrUpdate(String resourceGroupName, + String virtualNetworkName, VirtualNetworkInner resource); /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, Boolean force, Context context); + SyncPoller, VirtualNetworkInner> beginCreateOrUpdate(String resourceGroupName, + String virtualNetworkName, VirtualNetworkInner resource, Context context); /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName, Boolean force); + VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, + VirtualNetworkInner resource); /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName); - - /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String virtualNetworkName, Boolean force, Context context); + VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, + VirtualNetworkInner resource, Context context); /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualNetworkInner> beginUpdate( - String resourceGroupName, String virtualNetworkName, ResourcePatch body); + SyncPoller, VirtualNetworkInner> beginUpdate(String resourceGroupName, + String virtualNetworkName, VirtualNetworkTagsUpdate properties); /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @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. @@ -206,29 +183,30 @@ SyncPoller, VirtualNetworkInner> beginUpdate( * @return the {@link SyncPoller} for polling of the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VirtualNetworkInner> beginUpdate( - String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context); + SyncPoller, VirtualNetworkInner> beginUpdate(String resourceGroupName, + String virtualNetworkName, VirtualNetworkTagsUpdate properties, Context context); /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName, ResourcePatch body); + VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName, + VirtualNetworkTagsUpdate properties); /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @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. @@ -236,53 +214,61 @@ SyncPoller, VirtualNetworkInner> beginUpdate( * @return the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VirtualNetworkInner update( - String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context); + VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName, VirtualNetworkTagsUpdate properties, + Context context); /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName); /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @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 list of VirtualNetworks as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, Boolean force, + Context context); /** - * List of VirtualNetworks in a subscription. - * + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualNetworkName); /** - * List of VirtualNetworks in a subscription. - * + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @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 list of VirtualNetworks as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String virtualNetworkName, Boolean force, Context context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VmInstanceHybridIdentityMetadatasClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VmInstanceHybridIdentityMetadatasClient.java new file mode 100644 index 0000000000000..0a8d01f78b0da --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VmInstanceHybridIdentityMetadatasClient.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.scvmm.fluent.models.VmInstanceHybridIdentityMetadataInner; + +/** + * An instance of this class provides access to all the operations defined in VmInstanceHybridIdentityMetadatasClient. + */ +public interface VmInstanceHybridIdentityMetadatasClient { + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmInstanceHybridIdentityMetadata list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualMachineInstance(String resourceUri); + + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 response of a VmInstanceHybridIdentityMetadata list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVirtualMachineInstance(String resourceUri, + Context context); + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 defines the HybridIdentityMetadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, Context context); + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VmInstanceHybridIdentityMetadataInner get(String resourceUri); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VmmServersClient.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VmmServersClient.java index fa50ed9e81f21..63c3bde0ef292 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VmmServersClient.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/VmmServersClient.java @@ -12,192 +12,169 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.scvmm.fluent.models.VmmServerInner; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; +import com.azure.resourcemanager.scvmm.models.VmmServerTagsUpdate; -/** An instance of this class provides access to all the operations defined in VmmServersClient. */ +/** + * An instance of this class provides access to all the operations defined in VmmServersClient. + */ public interface VmmServersClient { /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VmmServers in a 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 the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - VmmServerInner getByResourceGroup(String resourceGroupName, String vmmServerName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * List of VmmServers in a 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 the VmmServers resource definition along with {@link Response}. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String vmmServerName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * List of VmmServers in a 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 the {@link SyncPoller} for polling of the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VmmServerInner> beginCreateOrUpdate( - String resourceGroupName, String vmmServerName, VmmServerInner body); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * List of VmmServers in a 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 the {@link SyncPoller} for polling of the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VmmServerInner> beginCreateOrUpdate( - String resourceGroupName, String vmmServerName, VmmServerInner body, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @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 VmmServers resource definition. + * @return the VmmServers resource definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - VmmServerInner createOrUpdate(String resourceGroupName, String vmmServerName, VmmServerInner body); + Response getByResourceGroupWithResponse(String resourceGroupName, String vmmServerName, + Context context); /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. - * @param context The context to associate with this operation. + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VmmServerInner createOrUpdate(String resourceGroupName, String vmmServerName, VmmServerInner body, Context context); + VmmServerInner getByResourceGroup(String resourceGroupName, String vmmServerName); /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String vmmServerName, Boolean force); + SyncPoller, VmmServerInner> beginCreateOrUpdate(String resourceGroupName, + String vmmServerName, VmmServerInner resource); /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @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 VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String vmmServerName, Boolean force, Context context); + SyncPoller, VmmServerInner> beginCreateOrUpdate(String resourceGroupName, + String vmmServerName, VmmServerInner resource, Context context); /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmmServerName, Boolean force); - - /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmmServerName); + VmmServerInner createOrUpdate(String resourceGroupName, String vmmServerName, VmmServerInner resource); /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @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 VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String vmmServerName, Boolean force, Context context); + VmmServerInner createOrUpdate(String resourceGroupName, String vmmServerName, VmmServerInner resource, + Context context); /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VmmServerInner> beginUpdate( - String resourceGroupName, String vmmServerName, ResourcePatch body); + SyncPoller, VmmServerInner> beginUpdate(String resourceGroupName, String vmmServerName, + VmmServerTagsUpdate properties); /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @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. @@ -205,29 +182,29 @@ SyncPoller, VmmServerInner> beginUpdate( * @return the {@link SyncPoller} for polling of the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VmmServerInner> beginUpdate( - String resourceGroupName, String vmmServerName, ResourcePatch body, Context context); + SyncPoller, VmmServerInner> beginUpdate(String resourceGroupName, String vmmServerName, + VmmServerTagsUpdate properties, Context context); /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VmmServerInner update(String resourceGroupName, String vmmServerName, ResourcePatch body); + VmmServerInner update(String resourceGroupName, String vmmServerName, VmmServerTagsUpdate properties); /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @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. @@ -235,52 +212,61 @@ SyncPoller, VmmServerInner> beginUpdate( * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - VmmServerInner update(String resourceGroupName, String vmmServerName, ResourcePatch body, Context context); + VmmServerInner update(String resourceGroupName, String vmmServerName, VmmServerTagsUpdate properties, + Context context); /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String vmmServerName); /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @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 list of VmmServers as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String vmmServerName, Boolean force, + Context context); /** - * List of VmmServers in a subscription. - * + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vmmServerName); /** - * List of VmmServers in a subscription. - * + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @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 list of VmmServers as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String vmmServerName, Boolean force, Context context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/AvailabilitySetInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/AvailabilitySetInner.java index ff4f7f540c2ac..cc99939051774 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/AvailabilitySetInner.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/AvailabilitySetInner.java @@ -7,52 +7,64 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.scvmm.models.AvailabilitySetProperties; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The AvailabilitySets resource definition. */ +/** + * The AvailabilitySets resource definition. + */ @Fluent public final class AvailabilitySetInner extends Resource { /* - * Resource properties. + * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private AvailabilitySetProperties innerProperties; + private AvailabilitySetProperties properties; /* - * The system data. + * The extended location. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * The extended location. + /** + * Creates an instance of AvailabilitySetInner class. */ - @JsonProperty(value = "extendedLocation") - private ExtendedLocation extendedLocation; + public AvailabilitySetInner() { + } /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - private AvailabilitySetProperties innerProperties() { - return this.innerProperties; + public AvailabilitySetProperties properties() { + return this.properties; } /** - * Get the systemData property: The system data. - * - * @return the systemData value. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AvailabilitySetInner object itself. */ - public SystemData systemData() { - return this.systemData; + public AvailabilitySetInner withProperties(AvailabilitySetProperties properties) { + this.properties = properties; + return this; } /** * Get the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -61,7 +73,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extended location. - * + * * @param extendedLocation the extendedLocation value to set. * @return the AvailabilitySetInner object itself. */ @@ -70,86 +82,49 @@ public AvailabilitySetInner withExtendedLocation(ExtendedLocation extendedLocati return this; } - /** {@inheritDoc} */ - @Override - public AvailabilitySetInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AvailabilitySetInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** - * Get the availabilitySetName property: Name of the availability set. - * - * @return the availabilitySetName value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public String availabilitySetName() { - return this.innerProperties() == null ? null : this.innerProperties().availabilitySetName(); + public SystemData systemData() { + return this.systemData; } /** - * Set the availabilitySetName property: Name of the availability set. - * - * @param availabilitySetName the availabilitySetName value to set. - * @return the AvailabilitySetInner object itself. + * {@inheritDoc} */ - public AvailabilitySetInner withAvailabilitySetName(String availabilitySetName) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withAvailabilitySetName(availabilitySetName); + @Override + public AvailabilitySetInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - public String vmmServerId() { - return this.innerProperties() == null ? null : this.innerProperties().vmmServerId(); - } - - /** - * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @param vmmServerId the vmmServerId value to set. - * @return the AvailabilitySetInner object itself. + * {@inheritDoc} */ - public AvailabilitySetInner withVmmServerId(String vmmServerId) { - if (this.innerProperties() == null) { - this.innerProperties = new AvailabilitySetProperties(); - } - this.innerProperties().withVmmServerId(vmmServerId); + @Override + public AvailabilitySetInner withTags(Map tags) { + super.withTags(tags); return this; } - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } - if (extendedLocation() != null) { + if (extendedLocation() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property extendedLocation in model AvailabilitySetInner")); + } else { extendedLocation().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(AvailabilitySetInner.class); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/CloudInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/CloudInner.java index ee1551b8e7c3c..4a43b31b5a25a 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/CloudInner.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/CloudInner.java @@ -8,55 +8,63 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.scvmm.models.CloudCapacity; +import com.azure.resourcemanager.scvmm.models.CloudProperties; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.StorageQoSPolicy; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; import java.util.Map; -/** The Clouds resource definition. */ +/** + * The Clouds resource definition. + */ @Fluent public final class CloudInner extends Resource { /* - * Resource properties. + * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) - private CloudProperties innerProperties = new CloudProperties(); + @JsonProperty(value = "properties") + private CloudProperties properties; /* - * The system data. + * The extended location. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * The extended location. + /** + * Creates an instance of CloudInner class. */ - @JsonProperty(value = "extendedLocation", required = true) - private ExtendedLocation extendedLocation; + public CloudInner() { + } /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - private CloudProperties innerProperties() { - return this.innerProperties; + public CloudProperties properties() { + return this.properties; } /** - * Get the systemData property: The system data. - * - * @return the systemData value. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CloudInner object itself. */ - public SystemData systemData() { - return this.systemData; + public CloudInner withProperties(CloudProperties properties) { + this.properties = properties; + return this; } /** * Get the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -65,7 +73,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extended location. - * + * * @param extendedLocation the extendedLocation value to set. * @return the CloudInner object itself. */ @@ -74,142 +82,45 @@ public CloudInner withExtendedLocation(ExtendedLocation extendedLocation) { return this; } - /** {@inheritDoc} */ - @Override - public CloudInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public CloudInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - public String inventoryItemId() { - return this.innerProperties() == null ? null : this.innerProperties().inventoryItemId(); - } - - /** - * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @param inventoryItemId the inventoryItemId value to set. - * @return the CloudInner object itself. - */ - public CloudInner withInventoryItemId(String inventoryItemId) { - if (this.innerProperties() == null) { - this.innerProperties = new CloudProperties(); - } - this.innerProperties().withInventoryItemId(inventoryItemId); - return this; - } - /** - * Get the uuid property: Unique ID of the cloud. - * - * @return the uuid value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public String uuid() { - return this.innerProperties() == null ? null : this.innerProperties().uuid(); + public SystemData systemData() { + return this.systemData; } /** - * Set the uuid property: Unique ID of the cloud. - * - * @param uuid the uuid value to set. - * @return the CloudInner object itself. + * {@inheritDoc} */ - public CloudInner withUuid(String uuid) { - if (this.innerProperties() == null) { - this.innerProperties = new CloudProperties(); - } - this.innerProperties().withUuid(uuid); + @Override + public CloudInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. + * {@inheritDoc} */ - public String vmmServerId() { - return this.innerProperties() == null ? null : this.innerProperties().vmmServerId(); - } - - /** - * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @param vmmServerId the vmmServerId value to set. - * @return the CloudInner object itself. - */ - public CloudInner withVmmServerId(String vmmServerId) { - if (this.innerProperties() == null) { - this.innerProperties = new CloudProperties(); - } - this.innerProperties().withVmmServerId(vmmServerId); + @Override + public CloudInner withTags(Map tags) { + super.withTags(tags); return this; } - /** - * Get the cloudName property: Name of the cloud in VMMServer. - * - * @return the cloudName value. - */ - public String cloudName() { - return this.innerProperties() == null ? null : this.innerProperties().cloudName(); - } - - /** - * Get the cloudCapacity property: Capacity of the cloud. - * - * @return the cloudCapacity value. - */ - public CloudCapacity cloudCapacity() { - return this.innerProperties() == null ? null : this.innerProperties().cloudCapacity(); - } - - /** - * Get the storageQoSPolicies property: List of QoS policies available for the cloud. - * - * @return the storageQoSPolicies value. - */ - public List storageQoSPolicies() { - return this.innerProperties() == null ? null : this.innerProperties().storageQoSPolicies(); - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model CloudInner")); - } else { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (extendedLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model CloudInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model CloudInner")); } else { extendedLocation().validate(); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/GuestAgentInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/GuestAgentInner.java new file mode 100644 index 0000000000000..e8f581b74e7fa --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/GuestAgentInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.scvmm.models.GuestAgentProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the GuestAgent. + */ +@Fluent +public final class GuestAgentInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private GuestAgentProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of GuestAgentInner class. + */ + public GuestAgentInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public GuestAgentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the GuestAgentInner object itself. + */ + public GuestAgentInner withProperties(GuestAgentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/InventoryItemInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/InventoryItemInner.java index b41488e2dd7d1..9517ee7c3ed16 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/InventoryItemInner.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/InventoryItemInner.java @@ -7,56 +7,65 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.scvmm.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the inventory item. */ +/** + * Defines the inventory item. + */ @Fluent public final class InventoryItemInner extends ProxyResource { /* - * Resource properties. + * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) - private InventoryItemProperties innerProperties = new InventoryItemProperties(); + @JsonProperty(value = "properties") + private InventoryItemProperties properties; /* - * The system data. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * Metadata used by portal/tooling/etc to render different UX experiences - * for resources of the same type; e.g. ApiApps are a kind of - * Microsoft.Web/sites type. If supported, the resource provider must - * validate and persist this value. + /** + * Creates an instance of InventoryItemInner class. */ - @JsonProperty(value = "kind") - private String kind; + public InventoryItemInner() { + } /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - private InventoryItemProperties innerProperties() { - return this.innerProperties; + public InventoryItemProperties properties() { + return this.properties; } /** - * Get the systemData property: The system data. - * - * @return the systemData value. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the InventoryItemInner object itself. */ - public SystemData systemData() { - return this.systemData; + public InventoryItemInner withProperties(InventoryItemProperties properties) { + this.properties = properties; + return this; } /** * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @return the kind value. */ public String kind() { @@ -67,7 +76,7 @@ public String kind() { * Set the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @param kind the kind value to set. * @return the InventoryItemInner object itself. */ @@ -77,56 +86,22 @@ public InventoryItemInner withKind(String kind) { } /** - * Get the managedResourceId property: Gets the tracked resource id corresponding to the inventory resource. - * - * @return the managedResourceId value. - */ - public String managedResourceId() { - return this.innerProperties() == null ? null : this.innerProperties().managedResourceId(); - } - - /** - * Get the uuid property: Gets the UUID (which is assigned by VMM) for the inventory item. - * - * @return the uuid value. - */ - public String uuid() { - return this.innerProperties() == null ? null : this.innerProperties().uuid(); - } - - /** - * Get the inventoryItemName property: Gets the Managed Object name in VMM for the inventory item. - * - * @return the inventoryItemName value. - */ - public String inventoryItemName() { - return this.innerProperties() == null ? null : this.innerProperties().inventoryItemName(); - } - - /** - * Get the provisioningState property: Gets the provisioning state. - * - * @return the provisioningState value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** * 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 InventoryItemInner")); - } else { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } - - private static final ClientLogger LOGGER = new ClientLogger(InventoryItemInner.class); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/OperationInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..388a193f29d8d --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/OperationInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.scvmm.models.ActionType; +import com.azure.resourcemanager.scvmm.models.OperationDisplay; +import com.azure.resourcemanager.scvmm.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * 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. + */ + 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() { + return this.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() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * 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() { + return this.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() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/ResourceProviderOperationInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/ResourceProviderOperationInner.java deleted file mode 100644 index 079a06ef5c788..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/ResourceProviderOperationInner.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.scvmm.models.ResourceProviderOperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Results of the request to list operations. */ -@Fluent -public final class ResourceProviderOperationInner { - /* - * Indicates whether the operation applies to data-plane. - */ - @JsonProperty(value = "isDataAction") - private String isDataAction; - - /* - * Operation name, in format of {provider}/{resource}/{operation}. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display metadata associated with the operation. - */ - @JsonProperty(value = "display") - private ResourceProviderOperationDisplay display; - - /** - * Get the isDataAction property: Indicates whether the operation applies to data-plane. - * - * @return the isDataAction value. - */ - public String isDataAction() { - return this.isDataAction; - } - - /** - * Set the isDataAction property: Indicates whether the operation applies to data-plane. - * - * @param isDataAction the isDataAction value to set. - * @return the ResourceProviderOperationInner object itself. - */ - public ResourceProviderOperationInner withIsDataAction(String isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Get the name property: Operation name, in format of {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name, in format of {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the ResourceProviderOperationInner object itself. - */ - public ResourceProviderOperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Display metadata associated with the operation. - * - * @return the display value. - */ - public ResourceProviderOperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display metadata associated with the operation. - * - * @param display the display value to set. - * @return the ResourceProviderOperationInner object itself. - */ - public ResourceProviderOperationInner withDisplay(ResourceProviderOperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineInner.java deleted file mode 100644 index 1ad3a83421bde..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineInner.java +++ /dev/null @@ -1,460 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.scvmm.models.AvailabilitySetListItem; -import com.azure.resourcemanager.scvmm.models.Checkpoint; -import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.HardwareProfile; -import com.azure.resourcemanager.scvmm.models.NetworkProfile; -import com.azure.resourcemanager.scvmm.models.OsProfile; -import com.azure.resourcemanager.scvmm.models.StorageProfile; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The VirtualMachines resource definition. */ -@Fluent -public final class VirtualMachineInner extends Resource { - /* - * Resource properties. - */ - @JsonProperty(value = "properties", required = true) - private VirtualMachineProperties innerProperties = new VirtualMachineProperties(); - - /* - * The system data. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * The extended location. - */ - @JsonProperty(value = "extendedLocation", required = true) - private ExtendedLocation extendedLocation; - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private VirtualMachineProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: The system data. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the extendedLocation property: The extended location. - * - * @return the extendedLocation value. - */ - public ExtendedLocation extendedLocation() { - return this.extendedLocation; - } - - /** - * Set the extendedLocation property: The extended location. - * - * @param extendedLocation the extendedLocation value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withExtendedLocation(ExtendedLocation extendedLocation) { - this.extendedLocation = extendedLocation; - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - public String inventoryItemId() { - return this.innerProperties() == null ? null : this.innerProperties().inventoryItemId(); - } - - /** - * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @param inventoryItemId the inventoryItemId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withInventoryItemId(String inventoryItemId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withInventoryItemId(inventoryItemId); - return this; - } - - /** - * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - public String vmmServerId() { - return this.innerProperties() == null ? null : this.innerProperties().vmmServerId(); - } - - /** - * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @param vmmServerId the vmmServerId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withVmmServerId(String vmmServerId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withVmmServerId(vmmServerId); - return this; - } - - /** - * Get the cloudId property: ARM Id of the cloud resource to use for deploying the vm. - * - * @return the cloudId value. - */ - public String cloudId() { - return this.innerProperties() == null ? null : this.innerProperties().cloudId(); - } - - /** - * Set the cloudId property: ARM Id of the cloud resource to use for deploying the vm. - * - * @param cloudId the cloudId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withCloudId(String cloudId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withCloudId(cloudId); - return this; - } - - /** - * Get the templateId property: ARM Id of the template resource to use for deploying the vm. - * - * @return the templateId value. - */ - public String templateId() { - return this.innerProperties() == null ? null : this.innerProperties().templateId(); - } - - /** - * Set the templateId property: ARM Id of the template resource to use for deploying the vm. - * - * @param templateId the templateId value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withTemplateId(String templateId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withTemplateId(templateId); - return this; - } - - /** - * Get the checkpointType property: Type of checkpoint supported for the vm. - * - * @return the checkpointType value. - */ - public String checkpointType() { - return this.innerProperties() == null ? null : this.innerProperties().checkpointType(); - } - - /** - * Set the checkpointType property: Type of checkpoint supported for the vm. - * - * @param checkpointType the checkpointType value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withCheckpointType(String checkpointType) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withCheckpointType(checkpointType); - return this; - } - - /** - * Get the checkpoints property: Checkpoints in the vm. - * - * @return the checkpoints value. - */ - public List checkpoints() { - return this.innerProperties() == null ? null : this.innerProperties().checkpoints(); - } - - /** - * Set the checkpoints property: Checkpoints in the vm. - * - * @param checkpoints the checkpoints value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withCheckpoints(List checkpoints) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withCheckpoints(checkpoints); - return this; - } - - /** - * Get the availabilitySets property: Availability Sets in vm. - * - * @return the availabilitySets value. - */ - public List availabilitySets() { - return this.innerProperties() == null ? null : this.innerProperties().availabilitySets(); - } - - /** - * Set the availabilitySets property: Availability Sets in vm. - * - * @param availabilitySets the availabilitySets value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withAvailabilitySets(List availabilitySets) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withAvailabilitySets(availabilitySets); - return this; - } - - /** - * Get the osProfile property: OS properties. - * - * @return the osProfile value. - */ - public OsProfile osProfile() { - return this.innerProperties() == null ? null : this.innerProperties().osProfile(); - } - - /** - * Set the osProfile property: OS properties. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withOsProfile(OsProfile osProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withOsProfile(osProfile); - return this; - } - - /** - * Get the hardwareProfile property: Hardware properties. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.innerProperties() == null ? null : this.innerProperties().hardwareProfile(); - } - - /** - * Set the hardwareProfile property: Hardware properties. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withHardwareProfile(HardwareProfile hardwareProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withHardwareProfile(hardwareProfile); - return this; - } - - /** - * Get the networkProfile property: Network properties. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); - } - - /** - * Set the networkProfile property: Network properties. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withNetworkProfile(NetworkProfile networkProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withNetworkProfile(networkProfile); - return this; - } - - /** - * Get the storageProfile property: Storage properties. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.innerProperties() == null ? null : this.innerProperties().storageProfile(); - } - - /** - * Set the storageProfile property: Storage properties. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withStorageProfile(StorageProfile storageProfile) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withStorageProfile(storageProfile); - return this; - } - - /** - * Get the vmName property: VMName is the name of VM on the SCVMM server. - * - * @return the vmName value. - */ - public String vmName() { - return this.innerProperties() == null ? null : this.innerProperties().vmName(); - } - - /** - * Set the vmName property: VMName is the name of VM on the SCVMM server. - * - * @param vmName the vmName value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withVmName(String vmName) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withVmName(vmName); - return this; - } - - /** - * Get the uuid property: Unique ID of the virtual machine. - * - * @return the uuid value. - */ - public String uuid() { - return this.innerProperties() == null ? null : this.innerProperties().uuid(); - } - - /** - * Set the uuid property: Unique ID of the virtual machine. - * - * @param uuid the uuid value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withUuid(String uuid) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withUuid(uuid); - return this; - } - - /** - * Get the generation property: Gets or sets the generation for the vm. - * - * @return the generation value. - */ - public Integer generation() { - return this.innerProperties() == null ? null : this.innerProperties().generation(); - } - - /** - * Set the generation property: Gets or sets the generation for the vm. - * - * @param generation the generation value to set. - * @return the VirtualMachineInner object itself. - */ - public VirtualMachineInner withGeneration(Integer generation) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineProperties(); - } - this.innerProperties().withGeneration(generation); - return this; - } - - /** - * Get the powerState property: Gets the power state of the virtual machine. - * - * @return the powerState value. - */ - public String powerState() { - return this.innerProperties() == null ? null : this.innerProperties().powerState(); - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model VirtualMachineInner")); - } else { - innerProperties().validate(); - } - if (extendedLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property extendedLocation in model VirtualMachineInner")); - } else { - extendedLocation().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInner.class); -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineInstanceInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineInstanceInner.java new file mode 100644 index 0000000000000..60719a5a71e61 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineInstanceInner.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.scvmm.models.ExtendedLocation; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Define the virtualMachineInstance. + */ +@Fluent +public final class VirtualMachineInstanceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private VirtualMachineInstanceProperties properties; + + /* + * Gets or sets the extended location. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of VirtualMachineInstanceInner class. + */ + public VirtualMachineInstanceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public VirtualMachineInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withProperties(VirtualMachineInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the extendedLocation property: Gets or sets the extended location. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: Gets or sets the extended location. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualMachineInstanceInner object itself. + */ + public VirtualMachineInstanceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (extendedLocation() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property extendedLocation in model VirtualMachineInstanceInner")); + } else { + extendedLocation().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstanceInner.class); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineProperties.java deleted file mode 100644 index 842675b918287..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineProperties.java +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.scvmm.models.AvailabilitySetListItem; -import com.azure.resourcemanager.scvmm.models.Checkpoint; -import com.azure.resourcemanager.scvmm.models.HardwareProfile; -import com.azure.resourcemanager.scvmm.models.NetworkProfile; -import com.azure.resourcemanager.scvmm.models.OsProfile; -import com.azure.resourcemanager.scvmm.models.StorageProfile; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Defines the resource properties. */ -@Fluent -public final class VirtualMachineProperties { - /* - * Gets or sets the inventory Item ID for the resource. - */ - @JsonProperty(value = "inventoryItemId") - private String inventoryItemId; - - /* - * ARM Id of the vmmServer resource in which this resource resides. - */ - @JsonProperty(value = "vmmServerId") - private String vmmServerId; - - /* - * ARM Id of the cloud resource to use for deploying the vm. - */ - @JsonProperty(value = "cloudId") - private String cloudId; - - /* - * ARM Id of the template resource to use for deploying the vm. - */ - @JsonProperty(value = "templateId") - private String templateId; - - /* - * Type of checkpoint supported for the vm. - */ - @JsonProperty(value = "checkpointType") - private String checkpointType; - - /* - * Checkpoints in the vm. - */ - @JsonProperty(value = "checkpoints") - private List checkpoints; - - /* - * Availability Sets in vm. - */ - @JsonProperty(value = "availabilitySets") - private List availabilitySets; - - /* - * OS properties. - */ - @JsonProperty(value = "osProfile") - private OsProfile osProfile; - - /* - * Hardware properties. - */ - @JsonProperty(value = "hardwareProfile") - private HardwareProfile hardwareProfile; - - /* - * Network properties. - */ - @JsonProperty(value = "networkProfile") - private NetworkProfile networkProfile; - - /* - * Storage properties. - */ - @JsonProperty(value = "storageProfile") - private StorageProfile storageProfile; - - /* - * VMName is the name of VM on the SCVMM server. - */ - @JsonProperty(value = "vmName") - private String vmName; - - /* - * Unique ID of the virtual machine. - */ - @JsonProperty(value = "uuid") - private String uuid; - - /* - * Gets or sets the generation for the vm. - */ - @JsonProperty(value = "generation") - private Integer generation; - - /* - * Gets the power state of the virtual machine. - */ - @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) - private String powerState; - - /* - * Gets or sets the provisioning state. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** - * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - public String inventoryItemId() { - return this.inventoryItemId; - } - - /** - * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @param inventoryItemId the inventoryItemId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withInventoryItemId(String inventoryItemId) { - this.inventoryItemId = inventoryItemId; - return this; - } - - /** - * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - public String vmmServerId() { - return this.vmmServerId; - } - - /** - * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @param vmmServerId the vmmServerId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withVmmServerId(String vmmServerId) { - this.vmmServerId = vmmServerId; - return this; - } - - /** - * Get the cloudId property: ARM Id of the cloud resource to use for deploying the vm. - * - * @return the cloudId value. - */ - public String cloudId() { - return this.cloudId; - } - - /** - * Set the cloudId property: ARM Id of the cloud resource to use for deploying the vm. - * - * @param cloudId the cloudId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withCloudId(String cloudId) { - this.cloudId = cloudId; - return this; - } - - /** - * Get the templateId property: ARM Id of the template resource to use for deploying the vm. - * - * @return the templateId value. - */ - public String templateId() { - return this.templateId; - } - - /** - * Set the templateId property: ARM Id of the template resource to use for deploying the vm. - * - * @param templateId the templateId value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withTemplateId(String templateId) { - this.templateId = templateId; - return this; - } - - /** - * Get the checkpointType property: Type of checkpoint supported for the vm. - * - * @return the checkpointType value. - */ - public String checkpointType() { - return this.checkpointType; - } - - /** - * Set the checkpointType property: Type of checkpoint supported for the vm. - * - * @param checkpointType the checkpointType value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withCheckpointType(String checkpointType) { - this.checkpointType = checkpointType; - return this; - } - - /** - * Get the checkpoints property: Checkpoints in the vm. - * - * @return the checkpoints value. - */ - public List checkpoints() { - return this.checkpoints; - } - - /** - * Set the checkpoints property: Checkpoints in the vm. - * - * @param checkpoints the checkpoints value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withCheckpoints(List checkpoints) { - this.checkpoints = checkpoints; - return this; - } - - /** - * Get the availabilitySets property: Availability Sets in vm. - * - * @return the availabilitySets value. - */ - public List availabilitySets() { - return this.availabilitySets; - } - - /** - * Set the availabilitySets property: Availability Sets in vm. - * - * @param availabilitySets the availabilitySets value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withAvailabilitySets(List availabilitySets) { - this.availabilitySets = availabilitySets; - return this; - } - - /** - * Get the osProfile property: OS properties. - * - * @return the osProfile value. - */ - public OsProfile osProfile() { - return this.osProfile; - } - - /** - * Set the osProfile property: OS properties. - * - * @param osProfile the osProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withOsProfile(OsProfile osProfile) { - this.osProfile = osProfile; - return this; - } - - /** - * Get the hardwareProfile property: Hardware properties. - * - * @return the hardwareProfile value. - */ - public HardwareProfile hardwareProfile() { - return this.hardwareProfile; - } - - /** - * Set the hardwareProfile property: Hardware properties. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withHardwareProfile(HardwareProfile hardwareProfile) { - this.hardwareProfile = hardwareProfile; - return this; - } - - /** - * Get the networkProfile property: Network properties. - * - * @return the networkProfile value. - */ - public NetworkProfile networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Network properties. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withNetworkProfile(NetworkProfile networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the storageProfile property: Storage properties. - * - * @return the storageProfile value. - */ - public StorageProfile storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Storage properties. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withStorageProfile(StorageProfile storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the vmName property: VMName is the name of VM on the SCVMM server. - * - * @return the vmName value. - */ - public String vmName() { - return this.vmName; - } - - /** - * Set the vmName property: VMName is the name of VM on the SCVMM server. - * - * @param vmName the vmName value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withVmName(String vmName) { - this.vmName = vmName; - return this; - } - - /** - * Get the uuid property: Unique ID of the virtual machine. - * - * @return the uuid value. - */ - public String uuid() { - return this.uuid; - } - - /** - * Set the uuid property: Unique ID of the virtual machine. - * - * @param uuid the uuid value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withUuid(String uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get the generation property: Gets or sets the generation for the vm. - * - * @return the generation value. - */ - public Integer generation() { - return this.generation; - } - - /** - * Set the generation property: Gets or sets the generation for the vm. - * - * @param generation the generation value to set. - * @return the VirtualMachineProperties object itself. - */ - public VirtualMachineProperties withGeneration(Integer generation) { - this.generation = generation; - return this; - } - - /** - * Get the powerState property: Gets the power state of the virtual machine. - * - * @return the powerState value. - */ - public String powerState() { - return this.powerState; - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (checkpoints() != null) { - checkpoints().forEach(e -> e.validate()); - } - if (availabilitySets() != null) { - availabilitySets().forEach(e -> e.validate()); - } - if (osProfile() != null) { - osProfile().validate(); - } - if (hardwareProfile() != null) { - hardwareProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineTemplateInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineTemplateInner.java index 780727522e47d..391c8fafe43a5 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineTemplateInner.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineTemplateInner.java @@ -8,59 +8,63 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.scvmm.models.DynamicMemoryEnabled; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.IsCustomizable; -import com.azure.resourcemanager.scvmm.models.LimitCpuForMigration; -import com.azure.resourcemanager.scvmm.models.NetworkInterfaces; -import com.azure.resourcemanager.scvmm.models.OsType; -import com.azure.resourcemanager.scvmm.models.VirtualDisk; +import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateProperties; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; import java.util.Map; -/** The VirtualMachineTemplates resource definition. */ +/** + * The VirtualMachineTemplates resource definition. + */ @Fluent public final class VirtualMachineTemplateInner extends Resource { /* - * Resource properties. + * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) - private VirtualMachineTemplateProperties innerProperties = new VirtualMachineTemplateProperties(); + @JsonProperty(value = "properties") + private VirtualMachineTemplateProperties properties; /* - * The system data. + * The extended location. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * The extended location. + /** + * Creates an instance of VirtualMachineTemplateInner class. */ - @JsonProperty(value = "extendedLocation", required = true) - private ExtendedLocation extendedLocation; + public VirtualMachineTemplateInner() { + } /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - private VirtualMachineTemplateProperties innerProperties() { - return this.innerProperties; + public VirtualMachineTemplateProperties properties() { + return this.properties; } /** - * Get the systemData property: The system data. - * - * @return the systemData value. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the VirtualMachineTemplateInner object itself. */ - public SystemData systemData() { - return this.systemData; + public VirtualMachineTemplateInner withProperties(VirtualMachineTemplateProperties properties) { + this.properties = properties; + return this; } /** * Get the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -69,7 +73,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extended location. - * + * * @param extendedLocation the extendedLocation value to set. * @return the VirtualMachineTemplateInner object itself. */ @@ -78,244 +82,45 @@ public VirtualMachineTemplateInner withExtendedLocation(ExtendedLocation extende return this; } - /** {@inheritDoc} */ - @Override - public VirtualMachineTemplateInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualMachineTemplateInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** - * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - public String inventoryItemId() { - return this.innerProperties() == null ? null : this.innerProperties().inventoryItemId(); - } - - /** - * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @param inventoryItemId the inventoryItemId value to set. - * @return the VirtualMachineTemplateInner object itself. - */ - public VirtualMachineTemplateInner withInventoryItemId(String inventoryItemId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineTemplateProperties(); - } - this.innerProperties().withInventoryItemId(inventoryItemId); - return this; - } - - /** - * Get the uuid property: Unique ID of the virtual machine template. - * - * @return the uuid value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public String uuid() { - return this.innerProperties() == null ? null : this.innerProperties().uuid(); + public SystemData systemData() { + return this.systemData; } /** - * Set the uuid property: Unique ID of the virtual machine template. - * - * @param uuid the uuid value to set. - * @return the VirtualMachineTemplateInner object itself. + * {@inheritDoc} */ - public VirtualMachineTemplateInner withUuid(String uuid) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineTemplateProperties(); - } - this.innerProperties().withUuid(uuid); + @Override + public VirtualMachineTemplateInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - public String vmmServerId() { - return this.innerProperties() == null ? null : this.innerProperties().vmmServerId(); - } - - /** - * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @param vmmServerId the vmmServerId value to set. - * @return the VirtualMachineTemplateInner object itself. + * {@inheritDoc} */ - public VirtualMachineTemplateInner withVmmServerId(String vmmServerId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualMachineTemplateProperties(); - } - this.innerProperties().withVmmServerId(vmmServerId); + @Override + public VirtualMachineTemplateInner withTags(Map tags) { + super.withTags(tags); return this; } - /** - * Get the osType property: Gets or sets the type of the os. - * - * @return the osType value. - */ - public OsType osType() { - return this.innerProperties() == null ? null : this.innerProperties().osType(); - } - - /** - * Get the osName property: Gets or sets os name. - * - * @return the osName value. - */ - public String osName() { - return this.innerProperties() == null ? null : this.innerProperties().osName(); - } - - /** - * Get the computerName property: Gets or sets computer name. - * - * @return the computerName value. - */ - public String computerName() { - return this.innerProperties() == null ? null : this.innerProperties().computerName(); - } - - /** - * Get the memoryMB property: MemoryMB is the desired size of a virtual machine's memory, in MB. - * - * @return the memoryMB value. - */ - public Integer memoryMB() { - return this.innerProperties() == null ? null : this.innerProperties().memoryMB(); - } - - /** - * Get the cpuCount property: Gets or sets the desired number of vCPUs for the vm. - * - * @return the cpuCount value. - */ - public Integer cpuCount() { - return this.innerProperties() == null ? null : this.innerProperties().cpuCount(); - } - - /** - * Get the limitCpuForMigration property: Gets or sets a value indicating whether to enable processor compatibility - * mode for live migration of VMs. - * - * @return the limitCpuForMigration value. - */ - public LimitCpuForMigration limitCpuForMigration() { - return this.innerProperties() == null ? null : this.innerProperties().limitCpuForMigration(); - } - - /** - * Get the dynamicMemoryEnabled property: Gets or sets a value indicating whether to enable dynamic memory or not. - * - * @return the dynamicMemoryEnabled value. - */ - public DynamicMemoryEnabled dynamicMemoryEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().dynamicMemoryEnabled(); - } - - /** - * Get the isCustomizable property: Gets or sets a value indicating whether the vm template is customizable or not. - * - * @return the isCustomizable value. - */ - public IsCustomizable isCustomizable() { - return this.innerProperties() == null ? null : this.innerProperties().isCustomizable(); - } - - /** - * Get the dynamicMemoryMaxMB property: Gets or sets the max dynamic memory for the vm. - * - * @return the dynamicMemoryMaxMB value. - */ - public Integer dynamicMemoryMaxMB() { - return this.innerProperties() == null ? null : this.innerProperties().dynamicMemoryMaxMB(); - } - - /** - * Get the dynamicMemoryMinMB property: Gets or sets the min dynamic memory for the vm. - * - * @return the dynamicMemoryMinMB value. - */ - public Integer dynamicMemoryMinMB() { - return this.innerProperties() == null ? null : this.innerProperties().dynamicMemoryMinMB(); - } - - /** - * Get the isHighlyAvailable property: Gets highly available property. - * - * @return the isHighlyAvailable value. - */ - public String isHighlyAvailable() { - return this.innerProperties() == null ? null : this.innerProperties().isHighlyAvailable(); - } - - /** - * Get the generation property: Gets or sets the generation for the vm. - * - * @return the generation value. - */ - public Integer generation() { - return this.innerProperties() == null ? null : this.innerProperties().generation(); - } - - /** - * Get the networkInterfaces property: Gets or sets the network interfaces of the template. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.innerProperties() == null ? null : this.innerProperties().networkInterfaces(); - } - - /** - * Get the disks property: Gets or sets the disks of the template. - * - * @return the disks value. - */ - public List disks() { - return this.innerProperties() == null ? null : this.innerProperties().disks(); - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model VirtualMachineTemplateInner")); - } else { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (extendedLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property extendedLocation in model VirtualMachineTemplateInner")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property extendedLocation in model VirtualMachineTemplateInner")); } else { extendedLocation().validate(); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualNetworkInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualNetworkInner.java index 6dbe4933b3545..b9c32c4da3b97 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualNetworkInner.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualNetworkInner.java @@ -9,51 +9,62 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; +import com.azure.resourcemanager.scvmm.models.VirtualNetworkProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The VirtualNetworks resource definition. */ +/** + * The VirtualNetworks resource definition. + */ @Fluent public final class VirtualNetworkInner extends Resource { /* - * Resource properties. + * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) - private VirtualNetworkProperties innerProperties = new VirtualNetworkProperties(); + @JsonProperty(value = "properties") + private VirtualNetworkProperties properties; /* - * The system data. + * The extended location. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * The extended location. + /** + * Creates an instance of VirtualNetworkInner class. */ - @JsonProperty(value = "extendedLocation", required = true) - private ExtendedLocation extendedLocation; + public VirtualNetworkInner() { + } /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - private VirtualNetworkProperties innerProperties() { - return this.innerProperties; + public VirtualNetworkProperties properties() { + return this.properties; } /** - * Get the systemData property: The system data. - * - * @return the systemData value. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the VirtualNetworkInner object itself. */ - public SystemData systemData() { - return this.systemData; + public VirtualNetworkInner withProperties(VirtualNetworkProperties properties) { + this.properties = properties; + return this; } /** * Get the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -62,7 +73,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extended location. - * + * * @param extendedLocation the extendedLocation value to set. * @return the VirtualNetworkInner object itself. */ @@ -71,126 +82,45 @@ public VirtualNetworkInner withExtendedLocation(ExtendedLocation extendedLocatio return this; } - /** {@inheritDoc} */ - @Override - public VirtualNetworkInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VirtualNetworkInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - public String inventoryItemId() { - return this.innerProperties() == null ? null : this.innerProperties().inventoryItemId(); - } - - /** - * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @param inventoryItemId the inventoryItemId value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withInventoryItemId(String inventoryItemId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkProperties(); - } - this.innerProperties().withInventoryItemId(inventoryItemId); - return this; - } - /** - * Get the uuid property: Unique ID of the virtual network. - * - * @return the uuid value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public String uuid() { - return this.innerProperties() == null ? null : this.innerProperties().uuid(); + public SystemData systemData() { + return this.systemData; } /** - * Set the uuid property: Unique ID of the virtual network. - * - * @param uuid the uuid value to set. - * @return the VirtualNetworkInner object itself. + * {@inheritDoc} */ - public VirtualNetworkInner withUuid(String uuid) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkProperties(); - } - this.innerProperties().withUuid(uuid); + @Override + public VirtualNetworkInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. + * {@inheritDoc} */ - public String vmmServerId() { - return this.innerProperties() == null ? null : this.innerProperties().vmmServerId(); - } - - /** - * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @param vmmServerId the vmmServerId value to set. - * @return the VirtualNetworkInner object itself. - */ - public VirtualNetworkInner withVmmServerId(String vmmServerId) { - if (this.innerProperties() == null) { - this.innerProperties = new VirtualNetworkProperties(); - } - this.innerProperties().withVmmServerId(vmmServerId); + @Override + public VirtualNetworkInner withTags(Map tags) { + super.withTags(tags); return this; } - /** - * Get the networkName property: Name of the virtual network in vmmServer. - * - * @return the networkName value. - */ - public String networkName() { - return this.innerProperties() == null ? null : this.innerProperties().networkName(); - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model VirtualNetworkInner")); - } else { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (extendedLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property extendedLocation in model VirtualNetworkInner")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property extendedLocation in model VirtualNetworkInner")); } else { extendedLocation().validate(); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmInstanceHybridIdentityMetadataInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmInstanceHybridIdentityMetadataInner.java new file mode 100644 index 0000000000000..9fd93df34a715 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmInstanceHybridIdentityMetadataInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadataProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the HybridIdentityMetadata. + */ +@Fluent +public final class VmInstanceHybridIdentityMetadataInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private VmInstanceHybridIdentityMetadataProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of VmInstanceHybridIdentityMetadataInner class. + */ + public VmInstanceHybridIdentityMetadataInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public VmInstanceHybridIdentityMetadataProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the VmInstanceHybridIdentityMetadataInner object itself. + */ + public VmInstanceHybridIdentityMetadataInner withProperties(VmInstanceHybridIdentityMetadataProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmmServerInner.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmmServerInner.java index 1a7055cbb9a41..b83f274eabaf4 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmmServerInner.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmmServerInner.java @@ -9,52 +9,62 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.VmmServerPropertiesCredentials; +import com.azure.resourcemanager.scvmm.models.VmmServerProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The VmmServers resource definition. */ +/** + * The VmmServers resource definition. + */ @Fluent public final class VmmServerInner extends Resource { /* - * Resource properties. + * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) - private VmmServerProperties innerProperties = new VmmServerProperties(); + @JsonProperty(value = "properties") + private VmmServerProperties properties; /* - * The system data. + * The extended location. + */ + @JsonProperty(value = "extendedLocation", required = true) + private ExtendedLocation extendedLocation; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * The extended location. + /** + * Creates an instance of VmmServerInner class. */ - @JsonProperty(value = "extendedLocation", required = true) - private ExtendedLocation extendedLocation; + public VmmServerInner() { + } /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - private VmmServerProperties innerProperties() { - return this.innerProperties; + public VmmServerProperties properties() { + return this.properties; } /** - * Get the systemData property: The system data. - * - * @return the systemData value. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the VmmServerInner object itself. */ - public SystemData systemData() { - return this.systemData; + public VmmServerInner withProperties(VmmServerProperties properties) { + this.properties = properties; + return this; } /** * Get the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ public ExtendedLocation extendedLocation() { @@ -63,7 +73,7 @@ public ExtendedLocation extendedLocation() { /** * Set the extendedLocation property: The extended location. - * + * * @param extendedLocation the extendedLocation value to set. * @return the VmmServerInner object itself. */ @@ -72,151 +82,45 @@ public VmmServerInner withExtendedLocation(ExtendedLocation extendedLocation) { return this; } - /** {@inheritDoc} */ - @Override - public VmmServerInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public VmmServerInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the credentials property: Credentials to connect to VMMServer. - * - * @return the credentials value. - */ - public VmmServerPropertiesCredentials credentials() { - return this.innerProperties() == null ? null : this.innerProperties().credentials(); - } - - /** - * Set the credentials property: Credentials to connect to VMMServer. - * - * @param credentials the credentials value to set. - * @return the VmmServerInner object itself. - */ - public VmmServerInner withCredentials(VmmServerPropertiesCredentials credentials) { - if (this.innerProperties() == null) { - this.innerProperties = new VmmServerProperties(); - } - this.innerProperties().withCredentials(credentials); - return this; - } - /** - * Get the fqdn property: Fqdn is the hostname/ip of the vmmServer. - * - * @return the fqdn value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public String fqdn() { - return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + public SystemData systemData() { + return this.systemData; } /** - * Set the fqdn property: Fqdn is the hostname/ip of the vmmServer. - * - * @param fqdn the fqdn value to set. - * @return the VmmServerInner object itself. + * {@inheritDoc} */ - public VmmServerInner withFqdn(String fqdn) { - if (this.innerProperties() == null) { - this.innerProperties = new VmmServerProperties(); - } - this.innerProperties().withFqdn(fqdn); + @Override + public VmmServerInner withLocation(String location) { + super.withLocation(location); return this; } /** - * Get the port property: Port is the port on which the vmmServer is listening. - * - * @return the port value. - */ - public Integer port() { - return this.innerProperties() == null ? null : this.innerProperties().port(); - } - - /** - * Set the port property: Port is the port on which the vmmServer is listening. - * - * @param port the port value to set. - * @return the VmmServerInner object itself. + * {@inheritDoc} */ - public VmmServerInner withPort(Integer port) { - if (this.innerProperties() == null) { - this.innerProperties = new VmmServerProperties(); - } - this.innerProperties().withPort(port); + @Override + public VmmServerInner withTags(Map tags) { + super.withTags(tags); return this; } - /** - * Get the connectionStatus property: Gets or sets the connection status to the vmmServer. - * - * @return the connectionStatus value. - */ - public String connectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); - } - - /** - * Get the errorMessage property: Gets or sets any error message if connection to vmmServer is having any issue. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); - } - - /** - * Get the uuid property: Unique ID of vmmServer. - * - * @return the uuid value. - */ - public String uuid() { - return this.innerProperties() == null ? null : this.innerProperties().uuid(); - } - - /** - * Get the version property: Version is the version of the vmmSever. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model VmmServerInner")); - } else { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } if (extendedLocation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property extendedLocation in model VmmServerInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property extendedLocation in model VmmServerInner")); } else { extendedLocation().validate(); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/package-info.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/package-info.java index e29b1393b6ea8..04a3c49ce47ce 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/package-info.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for ScvmmClient. SCVMM Client. */ +/** + * Package containing the inner data models for ScvmmClient. + * SCVMM Client. + */ package com.azure.resourcemanager.scvmm.fluent.models; diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/package-info.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/package-info.java index e998cfd26c0a8..af00da8e8cdc6 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/package-info.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for ScvmmClient. SCVMM Client. */ +/** + * Package containing the service clients for ScvmmClient. + * SCVMM Client. + */ package com.azure.resourcemanager.scvmm.fluent; diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetImpl.java index 4390fab75a5de..ff7e3ae69c3c1 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetImpl.java @@ -9,8 +9,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.AvailabilitySetInner; import com.azure.resourcemanager.scvmm.models.AvailabilitySet; +import com.azure.resourcemanager.scvmm.models.AvailabilitySetProperties; +import com.azure.resourcemanager.scvmm.models.AvailabilitySetTagsUpdate; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; import java.util.Collections; import java.util.Map; @@ -44,24 +45,16 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); + public AvailabilitySetProperties properties() { + return this.innerModel().properties(); } public ExtendedLocation extendedLocation() { return this.innerModel().extendedLocation(); } - public String availabilitySetName() { - return this.innerModel().availabilitySetName(); - } - - public String vmmServerId() { - return this.innerModel().vmmServerId(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -72,6 +65,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public AvailabilitySetInner innerModel() { return this.innerObject; } @@ -82,9 +79,9 @@ private com.azure.resourcemanager.scvmm.ScvmmManager manager() { private String resourceGroupName; - private String availabilitySetName; + private String availabilitySetResourceName; - private ResourcePatch updateBody; + private AvailabilitySetTagsUpdate updateProperties; public AvailabilitySetImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -92,76 +89,57 @@ public AvailabilitySetImpl withExistingResourceGroup(String resourceGroupName) { } public AvailabilitySet create() { - this.innerObject = - serviceManager - .serviceClient() - .getAvailabilitySets() - .createOrUpdate(resourceGroupName, availabilitySetName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getAvailabilitySets().createOrUpdate(resourceGroupName, + availabilitySetResourceName, this.innerModel(), Context.NONE); return this; } public AvailabilitySet create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAvailabilitySets() - .createOrUpdate(resourceGroupName, availabilitySetName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getAvailabilitySets().createOrUpdate(resourceGroupName, + availabilitySetResourceName, this.innerModel(), context); return this; } AvailabilitySetImpl(String name, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerObject = new AvailabilitySetInner(); this.serviceManager = serviceManager; - this.availabilitySetName = name; + this.availabilitySetResourceName = name; } public AvailabilitySetImpl update() { - this.updateBody = new ResourcePatch(); + this.updateProperties = new AvailabilitySetTagsUpdate(); return this; } public AvailabilitySet apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAvailabilitySets() - .update(resourceGroupName, availabilitySetName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient().getAvailabilitySets().update(resourceGroupName, + availabilitySetResourceName, updateProperties, Context.NONE); return this; } public AvailabilitySet apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAvailabilitySets() - .update(resourceGroupName, availabilitySetName, updateBody, context); + this.innerObject = serviceManager.serviceClient().getAvailabilitySets().update(resourceGroupName, + availabilitySetResourceName, updateProperties, context); return this; } AvailabilitySetImpl(AvailabilitySetInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.availabilitySetName = Utils.getValueFromIdByName(innerObject.id(), "availabilitySets"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.availabilitySetResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "availabilitySets"); } public AvailabilitySet refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAvailabilitySets() - .getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAvailabilitySets() + .getByResourceGroupWithResponse(resourceGroupName, availabilitySetResourceName, Context.NONE).getValue(); return this; } public AvailabilitySet refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAvailabilitySets() - .getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAvailabilitySets() + .getByResourceGroupWithResponse(resourceGroupName, availabilitySetResourceName, context).getValue(); return this; } @@ -175,28 +153,23 @@ public AvailabilitySetImpl withRegion(String location) { return this; } + public AvailabilitySetImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + public AvailabilitySetImpl withTags(Map tags) { if (isInCreateMode()) { this.innerModel().withTags(tags); return this; } else { - this.updateBody.withTags(tags); + this.updateProperties.withTags(tags); return this; } } - public AvailabilitySetImpl withExtendedLocation(ExtendedLocation extendedLocation) { - this.innerModel().withExtendedLocation(extendedLocation); - return this; - } - - public AvailabilitySetImpl withAvailabilitySetName(String availabilitySetName) { - this.innerModel().withAvailabilitySetName(availabilitySetName); - return this; - } - - public AvailabilitySetImpl withVmmServerId(String vmmServerId) { - this.innerModel().withVmmServerId(vmmServerId); + public AvailabilitySetImpl withProperties(AvailabilitySetProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetsClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetsClientImpl.java index aa2b0656b2cb4..2a6152993e158 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetsClientImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetsClientImpl.java @@ -35,27 +35,33 @@ import com.azure.resourcemanager.scvmm.fluent.AvailabilitySetsClient; import com.azure.resourcemanager.scvmm.fluent.models.AvailabilitySetInner; import com.azure.resourcemanager.scvmm.models.AvailabilitySetListResult; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; +import com.azure.resourcemanager.scvmm.models.AvailabilitySetTagsUpdate; 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 AvailabilitySetsClient. */ +/** + * An instance of this class provides access to all the operations defined in AvailabilitySetsClient. + */ public final class AvailabilitySetsClientImpl implements AvailabilitySetsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AvailabilitySetsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ScvmmClientImpl client; /** * Initializes an instance of AvailabilitySetsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AvailabilitySetsClientImpl(ScvmmClientImpl client) { - this.service = - RestProxy.create(AvailabilitySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(AvailabilitySetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -65,949 +71,774 @@ public final class AvailabilitySetsClientImpl implements AvailabilitySetsClient */ @Host("{$host}") @ServiceInterface(name = "ScvmmClientAvailabil") - private interface AvailabilitySetsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/availabilitySets/{availabilitySetName}") - @ExpectedResponses({200}) + public interface AvailabilitySetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/availabilitySets") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("availabilitySetName") String availabilitySetName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/availabilitySets/{availabilitySetName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("availabilitySetName") String availabilitySetName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AvailabilitySetInner body, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/availabilitySets/{availabilitySetName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("availabilitySetName") String availabilitySetName, - @QueryParam("api-version") String apiVersion, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("availabilitySetResourceName") String availabilitySetResourceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/availabilitySets/{availabilitySetName}") - @ExpectedResponses({200, 201, 202}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("availabilitySetName") String availabilitySetName, - @BodyParam("application/json") ResourcePatch body, - @HeaderParam("Accept") String accept, + @PathParam("availabilitySetResourceName") String availabilitySetResourceName, + @BodyParam("application/json") AvailabilitySetInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/availabilitySets") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, + @PathParam("availabilitySetResourceName") String availabilitySetResourceName, + @BodyParam("application/json") AvailabilitySetTagsUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/availabilitySets") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("force") Boolean force, + @PathParam("availabilitySetResourceName") String availabilitySetResourceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of AvailabilitySets in a 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 the AvailabilitySets resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the response of a AvailabilitySet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String availabilitySetName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - availabilitySetName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); } /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * List of AvailabilitySets in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the AvailabilitySets resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the response of a AvailabilitySet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String availabilitySetName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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 (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - availabilitySetName, - this.client.getApiVersion(), - accept, - context); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of AvailabilitySets in a 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 the AvailabilitySets resource definition on successful completion of {@link Mono}. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String availabilitySetName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * List of AvailabilitySets in a subscription. + * + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetName) { - return getByResourceGroupAsync(resourceGroupName, availabilitySetName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * List of AvailabilitySets in a 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 the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List of AvailabilitySets in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the AvailabilitySets resource definition along with {@link Response}. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String availabilitySetName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * List of AvailabilitySets in a 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 the AvailabilitySets resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the response of a AvailabilitySet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - availabilitySetName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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())); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * List of AvailabilitySets in a 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 the AvailabilitySets resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the response of a AvailabilitySet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.")); + 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 (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - availabilitySetName, - this.client.getApiVersion(), - body, - accept, - context); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * List of AvailabilitySets in a 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 the {@link PollerFlux} for polling of the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AvailabilitySetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AvailabilitySetInner.class, - AvailabilitySetInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * List of AvailabilitySets in a 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 the {@link PollerFlux} for polling of the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AvailabilitySetInner> beginCreateOrUpdateAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AvailabilitySetInner.class, AvailabilitySetInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * List of AvailabilitySets in a 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 the {@link SyncPoller} for polling of the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AvailabilitySetInner> beginCreateOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, availabilitySetName, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * List of AvailabilitySets in a 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 the {@link SyncPoller} for polling of the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AvailabilitySetInner> beginCreateOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, availabilitySetName, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the AvailabilitySets resource definition on successful completion of {@link Mono}. + * @return the AvailabilitySets resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, availabilitySetName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String availabilitySetResourceName) { + 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 (availabilitySetResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter availabilitySetResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, availabilitySetResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the AvailabilitySets resource definition on successful completion of {@link Mono}. + * @return the AvailabilitySets resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, availabilitySetName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String availabilitySetResourceName, 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 (availabilitySetResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter availabilitySetResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, availabilitySetResourceName, accept, context); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the AvailabilitySets resource definition. + * @return the AvailabilitySets resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilitySetInner createOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body) { - return createOrUpdateAsync(resourceGroupName, availabilitySetName, body).block(); + private Mono getByResourceGroupAsync(String resourceGroupName, + String availabilitySetResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Onboards the ScVmm availability set as an Azure resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body Request payload. + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AvailabilitySets resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String availabilitySetResourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, availabilitySetResourceName, context).block(); + } + + /** + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilitySetInner createOrUpdate( - String resourceGroupName, String availabilitySetName, AvailabilitySetInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, availabilitySetName, body, context).block(); + public AvailabilitySetInner getByResourceGroup(String resourceGroupName, String availabilitySetResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, availabilitySetResourceName, Context.NONE).getValue(); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AvailabilitySets resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String availabilitySetName, Boolean force) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + if (availabilitySetResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter availabilitySetResourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - availabilitySetName, - this.client.getApiVersion(), - force, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, availabilitySetResourceName, resource, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the AvailabilitySets resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String availabilitySetName, Boolean force, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + if (availabilitySetResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter availabilitySetResourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - availabilitySetName, - this.client.getApiVersion(), - force, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, availabilitySetResourceName, resource, accept, context); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String availabilitySetName, Boolean force) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, availabilitySetName, force); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, AvailabilitySetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String availabilitySetResourceName, AvailabilitySetInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetResourceName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AvailabilitySetInner.class, AvailabilitySetInner.class, this.client.getContext()); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String availabilitySetName, Boolean force, Context context) { + private PollerFlux, AvailabilitySetInner> beginCreateOrUpdateAsync( + String resourceGroupName, String availabilitySetResourceName, AvailabilitySetInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, availabilitySetName, force, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, availabilitySetResourceName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AvailabilitySetInner.class, AvailabilitySetInner.class, context); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String availabilitySetName, Boolean force) { - return beginDeleteAsync(resourceGroupName, availabilitySetName, force).getSyncPoller(); + public SyncPoller, AvailabilitySetInner> beginCreateOrUpdate( + String resourceGroupName, String availabilitySetResourceName, AvailabilitySetInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, availabilitySetResourceName, resource).getSyncPoller(); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String availabilitySetName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, availabilitySetName, force, context).getSyncPoller(); - } - - /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String availabilitySetName, Boolean force) { - return beginDeleteAsync(resourceGroupName, availabilitySetName, force) - .last() - .flatMap(this.client::getLroFinalResultOrError); + public SyncPoller, AvailabilitySetInner> beginCreateOrUpdate( + String resourceGroupName, String availabilitySetResourceName, AvailabilitySetInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, availabilitySetResourceName, resource, context) + .getSyncPoller(); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 AvailabilitySets resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String availabilitySetName) { - final Boolean force = null; - return beginDeleteAsync(resourceGroupName, availabilitySetName, force) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, availabilitySetResourceName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the AvailabilitySets resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String availabilitySetName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, availabilitySetName, force, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, availabilitySetResourceName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String availabilitySetName, Boolean force) { - deleteAsync(resourceGroupName, availabilitySetName, force).block(); - } - - /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String availabilitySetName) { - final Boolean force = null; - deleteAsync(resourceGroupName, availabilitySetName, force).block(); + public AvailabilitySetInner createOrUpdate(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetInner resource) { + return createOrUpdateAsync(resourceGroupName, availabilitySetResourceName, resource).block(); } /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm availability set as an Azure resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String availabilitySetName, Boolean force, Context context) { - deleteAsync(resourceGroupName, availabilitySetName, force, context).block(); + public AvailabilitySetInner createOrUpdate(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, availabilitySetResourceName, resource, context).block(); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the AvailabilitySets resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the AvailabilitySets resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String availabilitySetName, ResourcePatch body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetTagsUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (availabilitySetResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter availabilitySetResourceName is required and cannot be null.")); } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - availabilitySetName, - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, availabilitySetResourceName, properties, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the AvailabilitySets resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the AvailabilitySets resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String availabilitySetName, ResourcePatch body, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetTagsUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (availabilitySetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter availabilitySetName is required and cannot be null.")); + if (availabilitySetResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter availabilitySetResourceName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - availabilitySetName, - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, availabilitySetResourceName, properties, accept, context); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1015,24 +846,19 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AvailabilitySetInner> beginUpdateAsync( - String resourceGroupName, String availabilitySetName, ResourcePatch body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, availabilitySetName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - AvailabilitySetInner.class, - AvailabilitySetInner.class, - this.client.getContext()); + String resourceGroupName, String availabilitySetResourceName, AvailabilitySetTagsUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, availabilitySetResourceName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AvailabilitySetInner.class, AvailabilitySetInner.class, this.client.getContext()); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1041,39 +867,38 @@ private PollerFlux, AvailabilitySetInner> begin */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AvailabilitySetInner> beginUpdateAsync( - String resourceGroupName, String availabilitySetName, ResourcePatch body, Context context) { + String resourceGroupName, String availabilitySetResourceName, AvailabilitySetTagsUpdate properties, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, availabilitySetName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AvailabilitySetInner.class, AvailabilitySetInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, availabilitySetResourceName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AvailabilitySetInner.class, AvailabilitySetInner.class, context); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AvailabilitySetInner> beginUpdate( - String resourceGroupName, String availabilitySetName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, availabilitySetName, body).getSyncPoller(); + public SyncPoller, AvailabilitySetInner> beginUpdate(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, availabilitySetResourceName, properties).getSyncPoller(); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1081,36 +906,36 @@ public SyncPoller, AvailabilitySetInner> beginU * @return the {@link SyncPoller} for polling of the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AvailabilitySetInner> beginUpdate( - String resourceGroupName, String availabilitySetName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, availabilitySetName, body, context).getSyncPoller(); + public SyncPoller, AvailabilitySetInner> beginUpdate(String resourceGroupName, + String availabilitySetResourceName, AvailabilitySetTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, availabilitySetResourceName, properties, context) + .getSyncPoller(); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the AvailabilitySets resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String availabilitySetName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, availabilitySetName, body) - .last() + private Mono updateAsync(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, availabilitySetResourceName, properties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1118,35 +943,35 @@ private Mono updateAsync( * @return the AvailabilitySets resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String availabilitySetName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, availabilitySetName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, availabilitySetResourceName, properties, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilitySetInner update(String resourceGroupName, String availabilitySetName, ResourcePatch body) { - return updateAsync(resourceGroupName, availabilitySetName, body).block(); + public AvailabilitySetInner update(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetTagsUpdate properties) { + return updateAsync(resourceGroupName, availabilitySetResourceName, properties).block(); } /** * Updates the AvailabilitySets resource. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param body AvailabilitySets patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1154,458 +979,382 @@ public AvailabilitySetInner update(String resourceGroupName, String availability * @return the AvailabilitySets resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AvailabilitySetInner update( - String resourceGroupName, String availabilitySetName, ResourcePatch body, Context context) { - return updateAsync(resourceGroupName, availabilitySetName, body, context).block(); + public AvailabilitySetInner update(String resourceGroupName, String availabilitySetResourceName, + AvailabilitySetTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, availabilitySetResourceName, properties, context).block(); } /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String availabilitySetResourceName, Boolean force) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (availabilitySetResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter availabilitySetResourceName is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, force, availabilitySetResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String availabilitySetResourceName, Boolean force, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (availabilitySetResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter availabilitySetResourceName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, force, availabilitySetResourceName, accept, context); } /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String availabilitySetResourceName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, availabilitySetResourceName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String availabilitySetResourceName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, availabilitySetResourceName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String availabilitySetResourceName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, availabilitySetResourceName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String availabilitySetResourceName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, availabilitySetResourceName, force).getSyncPoller(); } /** - * List of AvailabilitySets in a subscription. - * + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String availabilitySetResourceName, + Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, availabilitySetResourceName, force, context).getSyncPoller(); } /** - * List of AvailabilitySets in a subscription. - * - * @param context The context to associate with this operation. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + private Mono deleteAsync(String resourceGroupName, String availabilitySetResourceName, Boolean force) { + return beginDeleteAsync(resourceGroupName, availabilitySetResourceName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of AvailabilitySets in a subscription. - * + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String availabilitySetResourceName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, availabilitySetResourceName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of AvailabilitySets in a subscription. - * + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String availabilitySetResourceName, Boolean force, + Context context) { + return beginDeleteAsync(resourceGroupName, availabilitySetResourceName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of AvailabilitySets in a subscription. - * + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String availabilitySetResourceName) { + final Boolean force = null; + deleteAsync(resourceGroupName, availabilitySetResourceName, force).block(); } /** - * List of AvailabilitySets in a subscription. - * + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String availabilitySetResourceName, Boolean force, Context context) { + deleteAsync(resourceGroupName, availabilitySetResourceName, force, context).block(); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a AvailabilitySet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listBySubscriptionNext(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 nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a AvailabilitySet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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 - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a AvailabilitySet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a AvailabilitySet list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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 - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetsImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetsImpl.java index 63d4267c5eac6..8d7ac3006cfae 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetsImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/AvailabilitySetsImpl.java @@ -21,152 +21,119 @@ public final class AvailabilitySetsImpl implements AvailabilitySets { private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; - public AvailabilitySetsImpl( - AvailabilitySetsClient innerClient, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + public AvailabilitySetsImpl(AvailabilitySetsClient innerClient, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public AvailabilitySet getByResourceGroup(String resourceGroupName, String availabilitySetName) { - AvailabilitySetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, availabilitySetName); - if (inner != null) { - return new AvailabilitySetImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String availabilitySetName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AvailabilitySetImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); } - public void delete(String resourceGroupName, String availabilitySetName, Boolean force) { - this.serviceClient().delete(resourceGroupName, availabilitySetName, force); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); } - public void delete(String resourceGroupName, String availabilitySetName) { - this.serviceClient().delete(resourceGroupName, availabilitySetName); + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); } - public void delete(String resourceGroupName, String availabilitySetName, Boolean force, Context context) { - this.serviceClient().delete(resourceGroupName, availabilitySetName, force, context); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String availabilitySetResourceName, Context context) { + Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, + availabilitySetResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AvailabilitySetImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); + public AvailabilitySet getByResourceGroup(String resourceGroupName, String availabilitySetResourceName) { + AvailabilitySetInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, availabilitySetResourceName); + if (inner != null) { + return new AvailabilitySetImpl(inner, this.manager()); + } else { + return null; + } } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); + public void delete(String resourceGroupName, String availabilitySetResourceName) { + this.serviceClient().delete(resourceGroupName, availabilitySetResourceName); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AvailabilitySetImpl(inner1, this.manager())); + public void delete(String resourceGroupName, String availabilitySetResourceName, Boolean force, Context context) { + this.serviceClient().delete(resourceGroupName, availabilitySetResourceName, force, context); } public AvailabilitySet 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String availabilitySetName = Utils.getValueFromIdByName(id, "availabilitySets"); - if (availabilitySetName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'availabilitySets'.", id))); + String availabilitySetResourceName = ResourceManagerUtils.getValueFromIdByName(id, "availabilitySets"); + if (availabilitySetResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'availabilitySets'.", id))); } - return this.getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, Context.NONE).getValue(); + return this.getByResourceGroupWithResponse(resourceGroupName, availabilitySetResourceName, Context.NONE) + .getValue(); } 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String availabilitySetName = Utils.getValueFromIdByName(id, "availabilitySets"); - if (availabilitySetName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'availabilitySets'.", id))); + String availabilitySetResourceName = ResourceManagerUtils.getValueFromIdByName(id, "availabilitySets"); + if (availabilitySetResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'availabilitySets'.", id))); } - return this.getByResourceGroupWithResponse(resourceGroupName, availabilitySetName, context); + return this.getByResourceGroupWithResponse(resourceGroupName, availabilitySetResourceName, context); } public void deleteById(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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String availabilitySetName = Utils.getValueFromIdByName(id, "availabilitySets"); - if (availabilitySetName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'availabilitySets'.", id))); + String availabilitySetResourceName = ResourceManagerUtils.getValueFromIdByName(id, "availabilitySets"); + if (availabilitySetResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'availabilitySets'.", id))); } Boolean localForce = null; - this.delete(resourceGroupName, availabilitySetName, localForce, Context.NONE); + this.delete(resourceGroupName, availabilitySetResourceName, localForce, Context.NONE); } public void deleteByIdWithResponse(String id, Boolean force, 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String availabilitySetName = Utils.getValueFromIdByName(id, "availabilitySets"); - if (availabilitySetName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'availabilitySets'.", id))); + String availabilitySetResourceName = ResourceManagerUtils.getValueFromIdByName(id, "availabilitySets"); + if (availabilitySetResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'availabilitySets'.", id))); } - this.delete(resourceGroupName, availabilitySetName, force, context); + this.delete(resourceGroupName, availabilitySetResourceName, force, context); } private AvailabilitySetsClient serviceClient() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudImpl.java index 17e8e011ff66d..e2779e54f8955 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudImpl.java @@ -9,12 +9,10 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.CloudInner; import com.azure.resourcemanager.scvmm.models.Cloud; -import com.azure.resourcemanager.scvmm.models.CloudCapacity; +import com.azure.resourcemanager.scvmm.models.CloudProperties; +import com.azure.resourcemanager.scvmm.models.CloudTagsUpdate; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; -import com.azure.resourcemanager.scvmm.models.StorageQoSPolicy; import java.util.Collections; -import java.util.List; import java.util.Map; public final class CloudImpl implements Cloud, Cloud.Definition, Cloud.Update { @@ -47,45 +45,16 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); + public CloudProperties properties() { + return this.innerModel().properties(); } public ExtendedLocation extendedLocation() { return this.innerModel().extendedLocation(); } - public String inventoryItemId() { - return this.innerModel().inventoryItemId(); - } - - public String uuid() { - return this.innerModel().uuid(); - } - - public String vmmServerId() { - return this.innerModel().vmmServerId(); - } - - public String cloudName() { - return this.innerModel().cloudName(); - } - - public CloudCapacity cloudCapacity() { - return this.innerModel().cloudCapacity(); - } - - public List storageQoSPolicies() { - List inner = this.innerModel().storageQoSPolicies(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -96,6 +65,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public CloudInner innerModel() { return this.innerObject; } @@ -106,9 +79,9 @@ private com.azure.resourcemanager.scvmm.ScvmmManager manager() { private String resourceGroupName; - private String cloudName; + private String cloudResourceName; - private ResourcePatch updateBody; + private CloudTagsUpdate updateProperties; public CloudImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -116,70 +89,56 @@ public CloudImpl withExistingResourceGroup(String resourceGroupName) { } public Cloud create() { - this.innerObject = - serviceManager - .serviceClient() - .getClouds() - .createOrUpdate(resourceGroupName, cloudName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getClouds().createOrUpdate(resourceGroupName, + cloudResourceName, this.innerModel(), Context.NONE); return this; } public Cloud create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getClouds() - .createOrUpdate(resourceGroupName, cloudName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getClouds().createOrUpdate(resourceGroupName, + cloudResourceName, this.innerModel(), context); return this; } CloudImpl(String name, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerObject = new CloudInner(); this.serviceManager = serviceManager; - this.cloudName = name; + this.cloudResourceName = name; } public CloudImpl update() { - this.updateBody = new ResourcePatch(); + this.updateProperties = new CloudTagsUpdate(); return this; } public Cloud apply() { - this.innerObject = - serviceManager.serviceClient().getClouds().update(resourceGroupName, cloudName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient().getClouds().update(resourceGroupName, cloudResourceName, + updateProperties, Context.NONE); return this; } public Cloud apply(Context context) { - this.innerObject = - serviceManager.serviceClient().getClouds().update(resourceGroupName, cloudName, updateBody, context); + this.innerObject = serviceManager.serviceClient().getClouds().update(resourceGroupName, cloudResourceName, + updateProperties, context); return this; } CloudImpl(CloudInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.cloudName = Utils.getValueFromIdByName(innerObject.id(), "clouds"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clouds"); } public Cloud refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getClouds() - .getByResourceGroupWithResponse(resourceGroupName, cloudName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getClouds() + .getByResourceGroupWithResponse(resourceGroupName, cloudResourceName, Context.NONE).getValue(); return this; } public Cloud refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getClouds() - .getByResourceGroupWithResponse(resourceGroupName, cloudName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getClouds() + .getByResourceGroupWithResponse(resourceGroupName, cloudResourceName, context).getValue(); return this; } @@ -203,23 +162,13 @@ public CloudImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } else { - this.updateBody.withTags(tags); + this.updateProperties.withTags(tags); return this; } } - public CloudImpl withInventoryItemId(String inventoryItemId) { - this.innerModel().withInventoryItemId(inventoryItemId); - return this; - } - - public CloudImpl withUuid(String uuid) { - this.innerModel().withUuid(uuid); - return this; - } - - public CloudImpl withVmmServerId(String vmmServerId) { - this.innerModel().withVmmServerId(vmmServerId); + public CloudImpl withProperties(CloudProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudsClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudsClientImpl.java index 60776d333cfe9..5f1fc26e8cfbe 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudsClientImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudsClientImpl.java @@ -35,22 +35,28 @@ import com.azure.resourcemanager.scvmm.fluent.CloudsClient; import com.azure.resourcemanager.scvmm.fluent.models.CloudInner; import com.azure.resourcemanager.scvmm.models.CloudListResult; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; +import com.azure.resourcemanager.scvmm.models.CloudTagsUpdate; 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 CloudsClient. */ +/** + * An instance of this class provides access to all the operations defined in CloudsClient. + */ public final class CloudsClientImpl implements CloudsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final CloudsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ScvmmClientImpl client; /** * Initializes an instance of CloudsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ CloudsClientImpl(ScvmmClientImpl client) { @@ -64,868 +70,720 @@ public final class CloudsClientImpl implements CloudsClient { */ @Host("{$host}") @ServiceInterface(name = "ScvmmClientClouds") - private interface CloudsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds" - + "/{cloudName}") - @ExpectedResponses({200}) + public interface CloudsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/clouds") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudName") String cloudName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds" - + "/{cloudName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudName") String cloudName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CloudInner body, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds" - + "/{cloudName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("cloudName") String cloudName, - @QueryParam("api-version") String apiVersion, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, + @PathParam("cloudResourceName") String cloudResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds" - + "/{cloudName}") - @ExpectedResponses({200, 201, 202}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("cloudName") String cloudName, - @BodyParam("application/json") ResourcePatch body, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("cloudResourceName") String cloudResourceName, + @BodyParam("application/json") CloudInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, + @PathParam("cloudResourceName") String cloudResourceName, + @BodyParam("application/json") CloudTagsUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/clouds") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("force") Boolean force, + @PathParam("cloudResourceName") String cloudResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of Clouds in a 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 the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a Cloud list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String cloudName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (cloudName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - cloudName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); } /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * List of Clouds in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a Cloud list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String cloudName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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 (cloudName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - cloudName, - this.client.getApiVersion(), - accept, - context); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of Clouds in a 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 the Clouds resource definition on successful completion of {@link Mono}. + * @return the response of a Cloud list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String cloudName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, cloudName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * List of Clouds in a subscription. + * + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CloudInner getByResourceGroup(String resourceGroupName, String cloudName) { - return getByResourceGroupAsync(resourceGroupName, cloudName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * List of Clouds in a 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 the response of a Cloud list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List of Clouds in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Clouds resource definition along with {@link Response}. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String cloudName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, cloudName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * List of Clouds in a 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 the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a Cloud list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String cloudName, CloudInner body) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (cloudName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - cloudName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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())); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * List of Clouds in a 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 the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a Cloud list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String cloudName, CloudInner body, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.")); + 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 (cloudName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - cloudName, - this.client.getApiVersion(), - body, - accept, - context); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * List of Clouds in a 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 the {@link PollerFlux} for polling of the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudInner> beginCreateOrUpdateAsync( - String resourceGroupName, String cloudName, CloudInner body) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, cloudName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), CloudInner.class, CloudInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * List of Clouds in a 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 the {@link PollerFlux} for polling of the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudInner> beginCreateOrUpdateAsync( - String resourceGroupName, String cloudName, CloudInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, cloudName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), CloudInner.class, CloudInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * List of Clouds in a 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 the {@link SyncPoller} for polling of the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CloudInner> beginCreateOrUpdate( - String resourceGroupName, String cloudName, CloudInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, cloudName, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * List of Clouds in a 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 the {@link SyncPoller} for polling of the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CloudInner> beginCreateOrUpdate( - String resourceGroupName, String cloudName, CloudInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, cloudName, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Clouds resource definition on successful completion of {@link Mono}. + * @return the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String cloudName, CloudInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, cloudName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String cloudResourceName) { + 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 (cloudResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Clouds resource definition on successful completion of {@link Mono}. + * @return the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String cloudName, CloudInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, cloudName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String cloudResourceName, 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 (cloudResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudResourceName, accept, context); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Clouds resource definition. + * @return the Clouds resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CloudInner createOrUpdate(String resourceGroupName, String cloudName, CloudInner body) { - return createOrUpdateAsync(resourceGroupName, cloudName, body).block(); + private Mono getByResourceGroupAsync(String resourceGroupName, String cloudResourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Onboards the ScVmm fabric cloud as an Azure cloud resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Request payload. + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Clouds resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String cloudResourceName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudResourceName, context).block(); + } + + /** + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CloudInner createOrUpdate(String resourceGroupName, String cloudName, CloudInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, cloudName, body, context).block(); + public CloudInner getByResourceGroup(String resourceGroupName, String cloudResourceName) { + return getByResourceGroupWithResponse(resourceGroupName, cloudResourceName, Context.NONE).getValue(); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String cloudName, Boolean force) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String cloudResourceName, CloudInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (cloudName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudName is required and cannot be null.")); + if (cloudResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudResourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - cloudName, - this.client.getApiVersion(), - force, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudResourceName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String cloudName, Boolean force, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String cloudResourceName, CloudInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (cloudName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudName is required and cannot be null.")); + if (cloudResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudResourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - cloudName, - this.client.getApiVersion(), - force, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudResourceName, resource, accept, context); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String cloudName, Boolean force) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudName, force); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, CloudInner> beginCreateOrUpdateAsync(String resourceGroupName, + String cloudResourceName, CloudInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, cloudResourceName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), CloudInner.class, + CloudInner.class, this.client.getContext()); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String cloudName, Boolean force, Context context) { + private PollerFlux, CloudInner> beginCreateOrUpdateAsync(String resourceGroupName, + String cloudResourceName, CloudInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudName, force, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, cloudResourceName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), CloudInner.class, + CloudInner.class, context); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudName, Boolean force) { - return beginDeleteAsync(resourceGroupName, cloudName, force).getSyncPoller(); + public SyncPoller, CloudInner> beginCreateOrUpdate(String resourceGroupName, + String cloudResourceName, CloudInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, cloudResourceName, resource).getSyncPoller(); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String cloudName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, cloudName, force, context).getSyncPoller(); + public SyncPoller, CloudInner> beginCreateOrUpdate(String resourceGroupName, + String cloudResourceName, CloudInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, cloudResourceName, resource, context).getSyncPoller(); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String cloudName, Boolean force) { - return beginDeleteAsync(resourceGroupName, cloudName, force) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 Clouds resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String cloudName) { - final Boolean force = null; - return beginDeleteAsync(resourceGroupName, cloudName, force) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String cloudResourceName, + CloudInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudResourceName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Clouds resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String cloudName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, cloudName, force, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String cloudResourceName, + CloudInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudResourceName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String cloudName, Boolean force) { - deleteAsync(resourceGroupName, cloudName, force).block(); - } - - /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String cloudName) { - final Boolean force = null; - deleteAsync(resourceGroupName, cloudName, force).block(); + public CloudInner createOrUpdate(String resourceGroupName, String cloudResourceName, CloudInner resource) { + return createOrUpdateAsync(resourceGroupName, cloudResourceName, resource).block(); } /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the ScVmm fabric cloud as an Azure cloud resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String cloudName, Boolean force, Context context) { - deleteAsync(resourceGroupName, cloudName, force, context).block(); + public CloudInner createOrUpdate(String resourceGroupName, String cloudResourceName, CloudInner resource, + Context context) { + return createOrUpdateAsync(resourceGroupName, cloudResourceName, resource, context).block(); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String cloudName, ResourcePatch body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String cloudResourceName, + CloudTagsUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { + if (cloudResourceName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter cloudResourceName is required and cannot be null.")); } - if (cloudName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - cloudName, - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudResourceName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -933,73 +791,61 @@ private Mono>> updateWithResponseAsync( * @return the Clouds resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String cloudName, ResourcePatch body, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String cloudResourceName, + CloudTagsUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { + if (cloudResourceName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter cloudResourceName is required and cannot be null.")); } - if (cloudName == null) { - return Mono.error(new IllegalArgumentException("Parameter cloudName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - cloudName, - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cloudResourceName, properties, accept, context); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudInner> beginUpdateAsync( - String resourceGroupName, String cloudName, ResourcePatch body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, cloudName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), CloudInner.class, CloudInner.class, this.client.getContext()); + private PollerFlux, CloudInner> beginUpdateAsync(String resourceGroupName, + String cloudResourceName, CloudTagsUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, cloudResourceName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), CloudInner.class, + CloudInner.class, this.client.getContext()); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1007,39 +853,38 @@ private PollerFlux, CloudInner> beginUpdateAsync( * @return the {@link PollerFlux} for polling of the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CloudInner> beginUpdateAsync( - String resourceGroupName, String cloudName, ResourcePatch body, Context context) { + private PollerFlux, CloudInner> beginUpdateAsync(String resourceGroupName, + String cloudResourceName, CloudTagsUpdate properties, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, cloudName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), CloudInner.class, CloudInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, cloudResourceName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), CloudInner.class, + CloudInner.class, context); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CloudInner> beginUpdate( - String resourceGroupName, String cloudName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, cloudName, body).getSyncPoller(); + public SyncPoller, CloudInner> beginUpdate(String resourceGroupName, + String cloudResourceName, CloudTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, cloudResourceName, properties).getSyncPoller(); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1047,35 +892,35 @@ public SyncPoller, CloudInner> beginUpdate( * @return the {@link SyncPoller} for polling of the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CloudInner> beginUpdate( - String resourceGroupName, String cloudName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, cloudName, body, context).getSyncPoller(); + public SyncPoller, CloudInner> beginUpdate(String resourceGroupName, + String cloudResourceName, CloudTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, cloudResourceName, properties, context).getSyncPoller(); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Clouds resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String cloudName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, cloudName, body) - .last() + private Mono updateAsync(String resourceGroupName, String cloudResourceName, + CloudTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, cloudResourceName, properties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1083,35 +928,34 @@ private Mono updateAsync(String resourceGroupName, String cloudName, * @return the Clouds resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String cloudName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, cloudName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String cloudResourceName, CloudTagsUpdate properties, + Context context) { + return beginUpdateAsync(resourceGroupName, cloudResourceName, properties, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CloudInner update(String resourceGroupName, String cloudName, ResourcePatch body) { - return updateAsync(resourceGroupName, cloudName, body).block(); + public CloudInner update(String resourceGroupName, String cloudResourceName, CloudTagsUpdate properties) { + return updateAsync(resourceGroupName, cloudResourceName, properties).block(); } /** * Updates the Clouds resource. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param body Clouds patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1119,455 +963,376 @@ public CloudInner update(String resourceGroupName, String cloudName, ResourcePat * @return the Clouds resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CloudInner update(String resourceGroupName, String cloudName, ResourcePatch body, Context context) { - return updateAsync(resourceGroupName, cloudName, body, context).block(); + public CloudInner update(String resourceGroupName, String cloudResourceName, CloudTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, cloudResourceName, properties, context).block(); } /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String cloudResourceName, + Boolean force) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (cloudResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudResourceName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, force, cloudResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String cloudResourceName, + Boolean force, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (cloudResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudResourceName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, force, cloudResourceName, accept, context); } /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudResourceName, + Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudResourceName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudResourceName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudResourceName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudResourceName, + Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, cloudResourceName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudResourceName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, cloudResourceName, force).getSyncPoller(); } /** - * List of Clouds in a subscription. - * + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudResourceName, + Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, cloudResourceName, force, context).getSyncPoller(); } /** - * List of Clouds in a subscription. - * - * @param context The context to associate with this operation. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + private Mono deleteAsync(String resourceGroupName, String cloudResourceName, Boolean force) { + return beginDeleteAsync(resourceGroupName, cloudResourceName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of Clouds in a subscription. - * + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String cloudResourceName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, cloudResourceName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of Clouds in a subscription. - * + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String cloudResourceName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, cloudResourceName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of Clouds in a subscription. - * + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cloudResourceName) { + final Boolean force = null; + deleteAsync(resourceGroupName, cloudResourceName, force).block(); } /** - * List of Clouds in a subscription. - * + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cloudResourceName, Boolean force, Context context) { + deleteAsync(resourceGroupName, cloudResourceName, force, context).block(); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a Cloud list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listBySubscriptionNext(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 nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a Cloud list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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 - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a Cloud list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a Cloud list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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 - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudsImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudsImpl.java index b4ca6f79e4a46..5aaac75e1c78d 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudsImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/CloudsImpl.java @@ -26,136 +26,110 @@ public CloudsImpl(CloudsClient innerClient, com.azure.resourcemanager.scvmm.Scvm this.serviceManager = serviceManager; } - public Cloud getByResourceGroup(String resourceGroupName, String cloudName) { - CloudInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, cloudName); - if (inner != null) { - return new CloudImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String cloudName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, cloudName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CloudImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String cloudName, Boolean force) { - this.serviceClient().delete(resourceGroupName, cloudName, force); - } - - public void delete(String resourceGroupName, String cloudName) { - this.serviceClient().delete(resourceGroupName, cloudName); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudImpl(inner1, this.manager())); } - public void delete(String resourceGroupName, String cloudName, Boolean force, Context context) { - this.serviceClient().delete(resourceGroupName, cloudName, force, context); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new CloudImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new CloudImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudImpl(inner1, this.manager())); } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new CloudImpl(inner1, this.manager())); + public Response getByResourceGroupWithResponse(String resourceGroupName, String cloudResourceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, cloudResourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CloudImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new CloudImpl(inner1, this.manager())); + public Cloud getByResourceGroup(String resourceGroupName, String cloudResourceName) { + CloudInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, cloudResourceName); + if (inner != null) { + return new CloudImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String cloudResourceName) { + this.serviceClient().delete(resourceGroupName, cloudResourceName); + } + + public void delete(String resourceGroupName, String cloudResourceName, Boolean force, Context context) { + this.serviceClient().delete(resourceGroupName, cloudResourceName, force, context); } public Cloud 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String cloudName = Utils.getValueFromIdByName(id, "clouds"); - if (cloudName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clouds'.", id))); + String cloudResourceName = ResourceManagerUtils.getValueFromIdByName(id, "clouds"); + if (cloudResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clouds'.", id))); } - return this.getByResourceGroupWithResponse(resourceGroupName, cloudName, Context.NONE).getValue(); + return this.getByResourceGroupWithResponse(resourceGroupName, cloudResourceName, Context.NONE).getValue(); } 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String cloudName = Utils.getValueFromIdByName(id, "clouds"); - if (cloudName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clouds'.", id))); + String cloudResourceName = ResourceManagerUtils.getValueFromIdByName(id, "clouds"); + if (cloudResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clouds'.", id))); } - return this.getByResourceGroupWithResponse(resourceGroupName, cloudName, context); + return this.getByResourceGroupWithResponse(resourceGroupName, cloudResourceName, context); } public void deleteById(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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String cloudName = Utils.getValueFromIdByName(id, "clouds"); - if (cloudName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clouds'.", id))); + String cloudResourceName = ResourceManagerUtils.getValueFromIdByName(id, "clouds"); + if (cloudResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clouds'.", id))); } Boolean localForce = null; - this.delete(resourceGroupName, cloudName, localForce, Context.NONE); + this.delete(resourceGroupName, cloudResourceName, localForce, Context.NONE); } public void deleteByIdWithResponse(String id, Boolean force, 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String cloudName = Utils.getValueFromIdByName(id, "clouds"); - if (cloudName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'clouds'.", id))); + String cloudResourceName = ResourceManagerUtils.getValueFromIdByName(id, "clouds"); + if (cloudResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clouds'.", id))); } - this.delete(resourceGroupName, cloudName, force, context); + this.delete(resourceGroupName, cloudResourceName, force, context); } private CloudsClient serviceClient() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentImpl.java new file mode 100644 index 0000000000000..111b8a591f407 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentImpl.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.scvmm.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.scvmm.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.scvmm.models.GuestAgent; +import com.azure.resourcemanager.scvmm.models.GuestAgentProperties; + +public final class GuestAgentImpl implements GuestAgent { + private GuestAgentInner innerObject; + + private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; + + GuestAgentImpl(GuestAgentInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public GuestAgentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public GuestAgentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.scvmm.ScvmmManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentsClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentsClientImpl.java new file mode 100644 index 0000000000000..5399161cf23f8 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentsClientImpl.java @@ -0,0 +1,673 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.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.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.scvmm.fluent.GuestAgentsClient; +import com.azure.resourcemanager.scvmm.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.scvmm.models.GuestAgentListResult; +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 GuestAgentsClient. + */ +public final class GuestAgentsClientImpl implements GuestAgentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GuestAgentsService service; + + /** + * The service client containing this operation class. + */ + private final ScvmmClientImpl client; + + /** + * Initializes an instance of GuestAgentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GuestAgentsClientImpl(ScvmmClientImpl client) { + this.service + = RestProxy.create(GuestAgentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ScvmmClientGuestAgents to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ScvmmClientGuestAgen") + public interface GuestAgentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVirtualMachineInstance(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") GuestAgentInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVirtualMachineInstanceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a GuestAgent list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineInstanceSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByVirtualMachineInstance(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuestAgent list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineInstanceSinglePageAsync(String resourceUri, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVirtualMachineInstance(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a GuestAgent list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualMachineInstanceAsync(String resourceUri) { + return new PagedFlux<>(() -> listByVirtualMachineInstanceSinglePageAsync(resourceUri), + nextLink -> listByVirtualMachineInstanceNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuestAgent list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualMachineInstanceAsync(String resourceUri, Context context) { + return new PagedFlux<>(() -> listByVirtualMachineInstanceSinglePageAsync(resourceUri, context), + nextLink -> listByVirtualMachineInstanceNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a GuestAgent list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualMachineInstance(String resourceUri) { + return new PagedIterable<>(listByVirtualMachineInstanceAsync(resourceUri)); + } + + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuestAgent list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualMachineInstance(String resourceUri, Context context) { + return new PagedIterable<>(listByVirtualMachineInstanceAsync(resourceUri, context)); + } + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri 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(), resourceUri, accept, context); + } + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 defines the GuestAgent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuestAgentInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceUri, GuestAgentInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceUri, GuestAgentInner resource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, resource, accept, + context); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuestAgentInner> beginCreateAsync(String resourceUri, + GuestAgentInner resource) { + Mono>> mono = createWithResponseAsync(resourceUri, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GuestAgentInner.class, GuestAgentInner.class, this.client.getContext()); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GuestAgentInner> beginCreateAsync(String resourceUri, + GuestAgentInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceUri, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GuestAgentInner.class, GuestAgentInner.class, context); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuestAgentInner> beginCreate(String resourceUri, + GuestAgentInner resource) { + return this.beginCreateAsync(resourceUri, resource).getSyncPoller(); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GuestAgentInner> beginCreate(String resourceUri, + GuestAgentInner resource, Context context) { + return this.beginCreateAsync(resourceUri, resource, context).getSyncPoller(); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceUri, GuestAgentInner resource) { + return beginCreateAsync(resourceUri, resource).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceUri, GuestAgentInner resource, Context context) { + return beginCreateAsync(resourceUri, resource, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuestAgentInner create(String resourceUri, GuestAgentInner resource) { + return createAsync(resourceUri, resource).block(); + } + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GuestAgentInner create(String resourceUri, GuestAgentInner resource, Context context) { + return createAsync(resourceUri, resource, context).block(); + } + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri 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(), resourceUri, accept, context); + } + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri) { + return deleteWithResponseAsync(resourceUri).flatMap(ignored -> Mono.empty()); + } + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceUri, Context context) { + return deleteWithResponseAsync(resourceUri, context).block(); + } + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri) { + deleteWithResponse(resourceUri, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuestAgent list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineInstanceNextSinglePageAsync(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.listByVirtualMachineInstanceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuestAgent list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVirtualMachineInstanceNextSinglePageAsync(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.listByVirtualMachineInstanceNext(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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentsImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentsImpl.java new file mode 100644 index 0000000000000..9a56424f12ecf --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/GuestAgentsImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.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.scvmm.fluent.GuestAgentsClient; +import com.azure.resourcemanager.scvmm.fluent.models.GuestAgentInner; +import com.azure.resourcemanager.scvmm.models.GuestAgent; +import com.azure.resourcemanager.scvmm.models.GuestAgents; + +public final class GuestAgentsImpl implements GuestAgents { + private static final ClientLogger LOGGER = new ClientLogger(GuestAgentsImpl.class); + + private final GuestAgentsClient innerClient; + + private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; + + public GuestAgentsImpl(GuestAgentsClient innerClient, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByVirtualMachineInstance(String resourceUri) { + PagedIterable inner = this.serviceClient().listByVirtualMachineInstance(resourceUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + } + + public PagedIterable listByVirtualMachineInstance(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().listByVirtualMachineInstance(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GuestAgentImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GuestAgentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GuestAgent get(String resourceUri) { + GuestAgentInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public GuestAgent create(String resourceUri, GuestAgentInner resource) { + GuestAgentInner inner = this.serviceClient().create(resourceUri, resource); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public GuestAgent create(String resourceUri, GuestAgentInner resource, Context context) { + GuestAgentInner inner = this.serviceClient().create(resourceUri, resource, context); + if (inner != null) { + return new GuestAgentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceUri, Context context) { + return this.serviceClient().deleteWithResponse(resourceUri, context); + } + + public void delete(String resourceUri) { + this.serviceClient().delete(resourceUri); + } + + private GuestAgentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.scvmm.ScvmmManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemImpl.java index 7157463d7f076..11e08ef14eeca 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemImpl.java @@ -8,6 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemInner; import com.azure.resourcemanager.scvmm.models.InventoryItem; +import com.azure.resourcemanager.scvmm.models.InventoryItemProperties; public final class InventoryItemImpl implements InventoryItem, InventoryItem.Definition { private InventoryItemInner innerObject; @@ -31,28 +32,16 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public InventoryItemProperties properties() { + return this.innerModel().properties(); } public String kind() { return this.innerModel().kind(); } - public String managedResourceId() { - return this.innerModel().managedResourceId(); - } - - public String uuid() { - return this.innerModel().uuid(); - } - - public String inventoryItemName() { - return this.innerModel().inventoryItemName(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public InventoryItemInner innerModel() { @@ -67,7 +56,7 @@ private com.azure.resourcemanager.scvmm.ScvmmManager manager() { private String vmmServerName; - private String inventoryItemName; + private String inventoryItemResourceName; public InventoryItemImpl withExistingVmmServer(String resourceGroupName, String vmmServerName) { this.resourceGroupName = resourceGroupName; @@ -76,49 +65,38 @@ public InventoryItemImpl withExistingVmmServer(String resourceGroupName, String } public InventoryItem create() { - this.innerObject = - serviceManager - .serviceClient() - .getInventoryItems() - .createWithResponse( - resourceGroupName, vmmServerName, inventoryItemName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getInventoryItems().createWithResponse(resourceGroupName, + vmmServerName, inventoryItemResourceName, this.innerModel(), Context.NONE).getValue(); return this; } public InventoryItem create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getInventoryItems() - .createWithResponse(resourceGroupName, vmmServerName, inventoryItemName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getInventoryItems() + .createWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, this.innerModel(), context) + .getValue(); return this; } InventoryItemImpl(String name, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerObject = new InventoryItemInner(); this.serviceManager = serviceManager; - this.inventoryItemName = name; + this.inventoryItemResourceName = name; } public InventoryItem refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getInventoryItems() - .getWithResponse(resourceGroupName, vmmServerName, inventoryItemName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getInventoryItems() + .getWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, Context.NONE).getValue(); return this; } public InventoryItem refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getInventoryItems() - .getWithResponse(resourceGroupName, vmmServerName, inventoryItemName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getInventoryItems() + .getWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, context).getValue(); + return this; + } + + public InventoryItemImpl withProperties(InventoryItemProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemsClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemsClientImpl.java index 136791f05e827..fc902d7036998 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemsClientImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemsClientImpl.java @@ -30,25 +30,31 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.scvmm.fluent.InventoryItemsClient; import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemInner; -import com.azure.resourcemanager.scvmm.models.InventoryItemsList; +import com.azure.resourcemanager.scvmm.models.InventoryItemListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in InventoryItemsClient. */ +/** + * An instance of this class provides access to all the operations defined in InventoryItemsClient. + */ public final class InventoryItemsClientImpl implements InventoryItemsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final InventoryItemsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ScvmmClientImpl client; /** * Initializes an instance of InventoryItemsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ InventoryItemsClientImpl(ScvmmClientImpl client) { - this.service = - RestProxy.create(InventoryItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(InventoryItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,108 +64,77 @@ public final class InventoryItemsClientImpl implements InventoryItemsClient { */ @Host("{$host}") @ServiceInterface(name = "ScvmmClientInventory") - private interface InventoryItemsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" - + "/{vmmServerName}/inventoryItems/{inventoryItemName}") - @ExpectedResponses({200}) + public interface InventoryItemsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmmServerName") String vmmServerName, - @PathParam("inventoryItemName") String inventoryItemName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") InventoryItemInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" - + "/{vmmServerName}/inventoryItems/{inventoryItemName}") - @ExpectedResponses({200}) + Mono> listByVmmServer(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmmServerName") String vmmServerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmmServerName") String vmmServerName, - @PathParam("inventoryItemName") String inventoryItemName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" - + "/{vmmServerName}/inventoryItems/{inventoryItemName}") - @ExpectedResponses({200, 204}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmmServerName") String vmmServerName, + @PathParam("inventoryItemResourceName") String inventoryItemResourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmmServerName") String vmmServerName, - @PathParam("inventoryItemName") String inventoryItemName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmmServerName") String vmmServerName, + @PathParam("inventoryItemResourceName") String inventoryItemResourceName, + @BodyParam("application/json") InventoryItemInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" - + "/{vmmServerName}/inventoryItems") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVmmServer( - @HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmmServerName") String vmmServerName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmmServerName") String vmmServerName, + @PathParam("inventoryItemResourceName") String inventoryItemResourceName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVmmServerNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByVmmServerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Create Or Update InventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. - * @param body Request payload. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a InventoryItem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String vmmServerName, String inventoryItemName, InventoryItemInner body) { + private Mono> listByVmmServerSinglePageAsync(String resourceGroupName, + String vmmServerName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -168,62 +143,37 @@ private Mono> createWithResponseAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } - if (inventoryItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inventoryItemName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - inventoryItemName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.listByVmmServer(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, 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())); } /** - * Create Or Update InventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. - * @param body Request payload. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a InventoryItem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String vmmServerName, - String inventoryItemName, - InventoryItemInner body, - Context context) { + private Mono> listByVmmServerSinglePageAsync(String resourceGroupName, + String vmmServerName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -232,145 +182,102 @@ private Mono> createWithResponseAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } - if (inventoryItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inventoryItemName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - inventoryItemName, - this.client.getApiVersion(), - body, - accept, - context); + .listByVmmServer(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vmmServerName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Create Or Update InventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. - * @param body Request payload. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item on successful completion of {@link Mono}. + * @return the response of a InventoryItem list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String vmmServerName, String inventoryItemName, InventoryItemInner body) { - return createWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVmmServerAsync(String resourceGroupName, String vmmServerName) { + return new PagedFlux<>(() -> listByVmmServerSinglePageAsync(resourceGroupName, vmmServerName), + nextLink -> listByVmmServerNextSinglePageAsync(nextLink)); } /** - * Create Or Update InventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item on successful completion of {@link Mono}. + * @return the response of a InventoryItem list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String vmmServerName, String inventoryItemName) { - final InventoryItemInner body = null; - return createWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemName, body) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVmmServerAsync(String resourceGroupName, String vmmServerName, + Context context) { + return new PagedFlux<>(() -> listByVmmServerSinglePageAsync(resourceGroupName, vmmServerName, context), + nextLink -> listByVmmServerNextSinglePageAsync(nextLink, context)); } /** - * Create Or Update InventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item. + * @return the response of a InventoryItem list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InventoryItemInner create(String resourceGroupName, String vmmServerName, String inventoryItemName) { - final InventoryItemInner body = null; - return createAsync(resourceGroupName, vmmServerName, inventoryItemName, body).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName) { + return new PagedIterable<>(listByVmmServerAsync(resourceGroupName, vmmServerName)); } /** - * Create Or Update InventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. - * @param body Request payload. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item along with {@link Response}. + * @return the response of a InventoryItem list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String vmmServerName, - String inventoryItemName, - InventoryItemInner body, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName, Context context) { - return createWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemName, body, context).block(); + return new PagedIterable<>(listByVmmServerAsync(resourceGroupName, vmmServerName, context)); } /** * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the inventory item along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vmmServerName, String inventoryItemName) { + private Mono> getWithResponseAsync(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -379,33 +286,24 @@ private Mono> getWithResponseAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } - if (inventoryItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inventoryItemName is required and cannot be null.")); + if (inventoryItemResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter inventoryItemResourceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - inventoryItemName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, inventoryItemResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -413,19 +311,15 @@ private Mono> getWithResponseAsync( * @return defines the inventory item along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -434,108 +328,90 @@ private Mono> getWithResponseAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } - if (inventoryItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inventoryItemName is required and cannot be null.")); + if (inventoryItemResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter inventoryItemResourceName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - inventoryItemName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vmmServerName, inventoryItemResourceName, accept, context); } /** * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return defines the inventory item on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String vmmServerName, String inventoryItemName) { - return getWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + private Mono getAsync(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName) { + return getWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item. + * @return defines the inventory item along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public InventoryItemInner get(String resourceGroupName, String vmmServerName, String inventoryItemName) { - return getAsync(resourceGroupName, vmmServerName, inventoryItemName).block(); + public Response getWithResponse(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemResourceName, context).block(); } /** * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. - * @param context The context to associate with this operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item along with {@link Response}. + * @return defines the inventory item. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context) { - return getWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemName, context).block(); + public InventoryItemInner get(String resourceGroupName, String vmmServerName, String inventoryItemResourceName) { + return getWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, Context.NONE).getValue(); } /** - * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Create Or Update InventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 defines the inventory item along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String vmmServerName, String inventoryItemName) { + private Mono> createWithResponseAsync(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, InventoryItemInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -544,53 +420,46 @@ private Mono> deleteWithResponseAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } - if (inventoryItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inventoryItemName is required and cannot be null.")); + if (inventoryItemResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter inventoryItemResourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - inventoryItemName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, inventoryItemResourceName, resource, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Create Or Update InventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return defines the inventory item along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context) { + private Mono> createWithResponseAsync(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, InventoryItemInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -599,98 +468,100 @@ private Mono> deleteWithResponseAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } - if (inventoryItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter inventoryItemName is required and cannot be null.")); + if (inventoryItemResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter inventoryItemResourceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - inventoryItemName, - this.client.getApiVersion(), - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vmmServerName, inventoryItemResourceName, resource, accept, context); } /** - * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Create Or Update InventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 defines the inventory item on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vmmServerName, String inventoryItemName) { - return deleteWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemName) - .flatMap((Response res) -> Mono.empty()); + private Mono createAsync(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, InventoryItemInner resource) { + return createWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemResourceName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Create Or Update InventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the inventory item along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmmServerName, String inventoryItemName) { - deleteAsync(resourceGroupName, vmmServerName, inventoryItemName).block(); + public Response createWithResponse(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, InventoryItemInner resource, Context context) { + return createWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemResourceName, resource, context) + .block(); } /** - * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. - * @param context The context to associate with this operation. + * Create Or Update InventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return defines the inventory item. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context) { - return deleteWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemName, context).block(); + public InventoryItemInner create(String resourceGroupName, String vmmServerName, String inventoryItemResourceName, + InventoryItemInner resource) { + return createWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, resource, Context.NONE) + .getValue(); } /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * Deletes an inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmmServerSinglePageAsync( - String resourceGroupName, String vmmServerName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -699,56 +570,40 @@ private Mono> listByVmmServerSinglePageAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } + if (inventoryItemResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter inventoryItemResourceName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByVmmServer( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, inventoryItemResourceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * Deletes an inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmmServerSinglePageAsync( - String resourceGroupName, String vmmServerName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -757,104 +612,77 @@ private Mono> listByVmmServerSinglePageAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } + if (inventoryItemResourceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter inventoryItemResourceName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByVmmServer( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vmmServerName, inventoryItemResourceName, accept, context); } /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * Deletes an inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVmmServerAsync(String resourceGroupName, String vmmServerName) { - return new PagedFlux<>( - () -> listByVmmServerSinglePageAsync(resourceGroupName, vmmServerName), - nextLink -> listByVmmServerNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmmServerName, String inventoryItemResourceName) { + return deleteWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemResourceName) + .flatMap(ignored -> Mono.empty()); } /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * Deletes an inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByVmmServerAsync( - String resourceGroupName, String vmmServerName, Context context) { - return new PagedFlux<>( - () -> listByVmmServerSinglePageAsync(resourceGroupName, vmmServerName, context), - nextLink -> listByVmmServerNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName) { - return new PagedIterable<>(listByVmmServerAsync(resourceGroupName, vmmServerName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vmmServerName, inventoryItemResourceName, context).block(); } /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param context The context to associate with this operation. + * Deletes an inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByVmmServer( - String resourceGroupName, String vmmServerName, Context context) { - return new PagedIterable<>(listByVmmServerAsync(resourceGroupName, vmmServerName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmmServerName, String inventoryItemResourceName) { + deleteWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, Context.NONE); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a InventoryItem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByVmmServerNextSinglePageAsync(String nextLink) { @@ -862,60 +690,44 @@ private Mono> listByVmmServerNextSinglePageAsy 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.")); + 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.listByVmmServerNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a InventoryItem list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVmmServerNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByVmmServerNextSinglePageAsync(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.")); + 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 - .listByVmmServerNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByVmmServerNext(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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemsImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemsImpl.java index a07f975b9cc1f..f9d197cc18b29 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemsImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/InventoryItemsImpl.java @@ -21,164 +21,132 @@ public final class InventoryItemsImpl implements InventoryItems { private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; - public InventoryItemsImpl( - InventoryItemsClient innerClient, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + public InventoryItemsImpl(InventoryItemsClient innerClient, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public InventoryItem get(String resourceGroupName, String vmmServerName, String inventoryItemName) { - InventoryItemInner inner = this.serviceClient().get(resourceGroupName, vmmServerName, inventoryItemName); + public PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName) { + PagedIterable inner + = this.serviceClient().listByVmmServer(resourceGroupName, vmmServerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new InventoryItemImpl(inner1, this.manager())); + } + + public PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName, + Context context) { + PagedIterable inner + = this.serviceClient().listByVmmServer(resourceGroupName, vmmServerName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new InventoryItemImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, vmmServerName, + inventoryItemResourceName, context); if (inner != null) { - return new InventoryItemImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new InventoryItemImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, vmmServerName, inventoryItemName, context); + public InventoryItem get(String resourceGroupName, String vmmServerName, String inventoryItemResourceName) { + InventoryItemInner inner + = this.serviceClient().get(resourceGroupName, vmmServerName, inventoryItemResourceName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InventoryItemImpl(inner.getValue(), this.manager())); + return new InventoryItemImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String vmmServerName, String inventoryItemName) { - this.serviceClient().delete(resourceGroupName, vmmServerName, inventoryItemName); - } - - public Response deleteWithResponse( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, vmmServerName, inventoryItemName, context); - } - - public PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName) { - PagedIterable inner = - this.serviceClient().listByVmmServer(resourceGroupName, vmmServerName); - return Utils.mapPage(inner, inner1 -> new InventoryItemImpl(inner1, this.manager())); + public Response deleteWithResponse(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, + context); } - public PagedIterable listByVmmServer( - String resourceGroupName, String vmmServerName, Context context) { - PagedIterable inner = - this.serviceClient().listByVmmServer(resourceGroupName, vmmServerName, context); - return Utils.mapPage(inner, inner1 -> new InventoryItemImpl(inner1, this.manager())); + public void delete(String resourceGroupName, String vmmServerName, String inventoryItemResourceName) { + this.serviceClient().delete(resourceGroupName, vmmServerName, inventoryItemResourceName); } public InventoryItem 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String vmmServerName = Utils.getValueFromIdByName(id, "vmmServers"); + String vmmServerName = ResourceManagerUtils.getValueFromIdByName(id, "vmmServers"); if (vmmServerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); } - String inventoryItemName = Utils.getValueFromIdByName(id, "inventoryItems"); - if (inventoryItemName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'inventoryItems'.", id))); + String inventoryItemResourceName = ResourceManagerUtils.getValueFromIdByName(id, "inventoryItems"); + if (inventoryItemResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inventoryItems'.", id))); } - return this.getWithResponse(resourceGroupName, vmmServerName, inventoryItemName, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, Context.NONE) + .getValue(); } 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String vmmServerName = Utils.getValueFromIdByName(id, "vmmServers"); + String vmmServerName = ResourceManagerUtils.getValueFromIdByName(id, "vmmServers"); if (vmmServerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); } - String inventoryItemName = Utils.getValueFromIdByName(id, "inventoryItems"); - if (inventoryItemName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'inventoryItems'.", id))); + String inventoryItemResourceName = ResourceManagerUtils.getValueFromIdByName(id, "inventoryItems"); + if (inventoryItemResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inventoryItems'.", id))); } - return this.getWithResponse(resourceGroupName, vmmServerName, inventoryItemName, context); + return this.getWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, context); } public void deleteById(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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String vmmServerName = Utils.getValueFromIdByName(id, "vmmServers"); + String vmmServerName = ResourceManagerUtils.getValueFromIdByName(id, "vmmServers"); if (vmmServerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); } - String inventoryItemName = Utils.getValueFromIdByName(id, "inventoryItems"); - if (inventoryItemName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'inventoryItems'.", id))); + String inventoryItemResourceName = ResourceManagerUtils.getValueFromIdByName(id, "inventoryItems"); + if (inventoryItemResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inventoryItems'.", id))); } - this.deleteWithResponse(resourceGroupName, vmmServerName, inventoryItemName, Context.NONE); + this.deleteWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, Context.NONE); } public Response deleteByIdWithResponse(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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String vmmServerName = Utils.getValueFromIdByName(id, "vmmServers"); + String vmmServerName = ResourceManagerUtils.getValueFromIdByName(id, "vmmServers"); if (vmmServerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); } - String inventoryItemName = Utils.getValueFromIdByName(id, "inventoryItems"); - if (inventoryItemName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'inventoryItems'.", id))); + String inventoryItemResourceName = ResourceManagerUtils.getValueFromIdByName(id, "inventoryItems"); + if (inventoryItemResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inventoryItems'.", id))); } - return this.deleteWithResponse(resourceGroupName, vmmServerName, inventoryItemName, context); + return this.deleteWithResponse(resourceGroupName, vmmServerName, inventoryItemResourceName, context); } private InventoryItemsClient serviceClient() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationImpl.java new file mode 100644 index 0000000000000..803e4943d792c --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.implementation; + +import com.azure.resourcemanager.scvmm.fluent.models.OperationInner; +import com.azure.resourcemanager.scvmm.models.ActionType; +import com.azure.resourcemanager.scvmm.models.Operation; +import com.azure.resourcemanager.scvmm.models.OperationDisplay; +import com.azure.resourcemanager.scvmm.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.scvmm.ScvmmManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationsClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationsClientImpl.java index 6c2d34b068b27..a66a6bbcd3f4b 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationsClientImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationsClientImpl.java @@ -26,246 +26,214 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.scvmm.fluent.OperationsClient; -import com.azure.resourcemanager.scvmm.fluent.models.ResourceProviderOperationInner; -import com.azure.resourcemanager.scvmm.models.ResourceProviderOperationList; +import com.azure.resourcemanager.scvmm.fluent.models.OperationInner; +import com.azure.resourcemanager.scvmm.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 ScvmmClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(ScvmmClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ScvmmClientOperations to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for ScvmmClientOperations to be used by the proxy service to perform + * REST calls. */ @Host("{$host}") @ServiceInterface(name = "ScvmmClientOperation") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ScVmm/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationsImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationsImpl.java index 1157b91a72f8c..5d3bdc741a00e 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationsImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/OperationsImpl.java @@ -8,9 +8,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.scvmm.fluent.OperationsClient; -import com.azure.resourcemanager.scvmm.fluent.models.ResourceProviderOperationInner; +import com.azure.resourcemanager.scvmm.fluent.models.OperationInner; +import com.azure.resourcemanager.scvmm.models.Operation; import com.azure.resourcemanager.scvmm.models.Operations; -import com.azure.resourcemanager.scvmm.models.ResourceProviderOperation; public final class OperationsImpl implements Operations { private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); @@ -24,14 +24,14 @@ public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.sc this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + 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 ResourceProviderOperationImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/Utils.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ResourceManagerUtils.java similarity index 79% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/Utils.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ResourceManagerUtils.java index 75b2c07623be9..80af78c203008 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/Utils.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/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; @@ -38,6 +41,7 @@ static String getValueFromIdByName(String id, String name) { } } return null; + } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -60,7 +64,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); @@ -71,10 +75,11 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; + } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +89,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +129,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +191,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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ResourceProviderOperationImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ResourceProviderOperationImpl.java deleted file mode 100644 index c0e013e3c6614..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ResourceProviderOperationImpl.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.scvmm.implementation; - -import com.azure.resourcemanager.scvmm.fluent.models.ResourceProviderOperationInner; -import com.azure.resourcemanager.scvmm.models.ResourceProviderOperation; -import com.azure.resourcemanager.scvmm.models.ResourceProviderOperationDisplay; - -public final class ResourceProviderOperationImpl implements ResourceProviderOperation { - private ResourceProviderOperationInner innerObject; - - private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; - - ResourceProviderOperationImpl( - ResourceProviderOperationInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String isDataAction() { - return this.innerModel().isDataAction(); - } - - public String name() { - return this.innerModel().name(); - } - - public ResourceProviderOperationDisplay display() { - return this.innerModel().display(); - } - - public ResourceProviderOperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.scvmm.ScvmmManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ScvmmClientBuilder.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ScvmmClientBuilder.java index a4f2395c8a754..bf6bff5c7369b 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ScvmmClientBuilder.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ScvmmClientBuilder.java @@ -14,18 +14,19 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the ScvmmClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ScvmmClientImpl.class}) +/** + * A builder for creating a new instance of the ScvmmClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ScvmmClientImpl.class }) public final class ScvmmClientBuilder { /* - * The Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000). + * The ID of the target subscription. */ private String subscriptionId; /** - * Sets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * + * Sets The ID of the target subscription. + * * @param subscriptionId the subscriptionId value. * @return the ScvmmClientBuilder. */ @@ -41,7 +42,7 @@ public ScvmmClientBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the ScvmmClientBuilder. */ @@ -57,7 +58,7 @@ public ScvmmClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the ScvmmClientBuilder. */ @@ -73,7 +74,7 @@ public ScvmmClientBuilder environment(AzureEnvironment environment) { /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the ScvmmClientBuilder. */ @@ -89,7 +90,7 @@ public ScvmmClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the ScvmmClientBuilder. */ @@ -105,7 +106,7 @@ public ScvmmClientBuilder defaultPollInterval(Duration defaultPollInterval) { /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the ScvmmClientBuilder. */ @@ -116,28 +117,20 @@ public ScvmmClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) /** * Builds an instance of ScvmmClientImpl with the provided parameters. - * + * * @return an instance of ScvmmClientImpl. */ public ScvmmClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - ScvmmClientImpl client = - new ScvmmClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ScvmmClientImpl client = new ScvmmClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, + localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ScvmmClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ScvmmClientImpl.java index 417328600ef57..b62c9af20341b 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ScvmmClientImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/ScvmmClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -23,12 +24,14 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.scvmm.fluent.AvailabilitySetsClient; import com.azure.resourcemanager.scvmm.fluent.CloudsClient; +import com.azure.resourcemanager.scvmm.fluent.GuestAgentsClient; import com.azure.resourcemanager.scvmm.fluent.InventoryItemsClient; import com.azure.resourcemanager.scvmm.fluent.OperationsClient; import com.azure.resourcemanager.scvmm.fluent.ScvmmClient; +import com.azure.resourcemanager.scvmm.fluent.VirtualMachineInstancesClient; import com.azure.resourcemanager.scvmm.fluent.VirtualMachineTemplatesClient; -import com.azure.resourcemanager.scvmm.fluent.VirtualMachinesClient; import com.azure.resourcemanager.scvmm.fluent.VirtualNetworksClient; +import com.azure.resourcemanager.scvmm.fluent.VmInstanceHybridIdentityMetadatasClient; import com.azure.resourcemanager.scvmm.fluent.VmmServersClient; import java.io.IOException; import java.lang.reflect.Type; @@ -36,175 +39,232 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the ScvmmClientImpl type. */ +/** + * Initializes a new instance of the ScvmmClientImpl type. + */ @ServiceClient(builder = ScvmmClientBuilder.class) public final class ScvmmClientImpl implements ScvmmClient { - /** The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ + /** + * The ID of the target subscription. + */ private final String subscriptionId; /** - * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * + * Gets The ID of the target subscription. + * * @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 VmmServersClient object to access its operations. */ - private final VmmServersClient vmmServers; + /** + * The VirtualMachineInstancesClient object to access its operations. + */ + private final VirtualMachineInstancesClient virtualMachineInstances; /** - * Gets the VmmServersClient object to access its operations. - * - * @return the VmmServersClient object. + * Gets the VirtualMachineInstancesClient object to access its operations. + * + * @return the VirtualMachineInstancesClient object. */ - public VmmServersClient getVmmServers() { - return this.vmmServers; + public VirtualMachineInstancesClient getVirtualMachineInstances() { + return this.virtualMachineInstances; + } + + /** + * The GuestAgentsClient object to access its operations. + */ + private final GuestAgentsClient guestAgents; + + /** + * Gets the GuestAgentsClient object to access its operations. + * + * @return the GuestAgentsClient object. + */ + public GuestAgentsClient getGuestAgents() { + return this.guestAgents; + } + + /** + * The VmInstanceHybridIdentityMetadatasClient object to access its operations. + */ + private final VmInstanceHybridIdentityMetadatasClient vmInstanceHybridIdentityMetadatas; + + /** + * Gets the VmInstanceHybridIdentityMetadatasClient object to access its operations. + * + * @return the VmInstanceHybridIdentityMetadatasClient object. + */ + public VmInstanceHybridIdentityMetadatasClient getVmInstanceHybridIdentityMetadatas() { + return this.vmInstanceHybridIdentityMetadatas; } - /** 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 CloudsClient object to access its operations. */ + /** + * The AvailabilitySetsClient object to access its operations. + */ + private final AvailabilitySetsClient availabilitySets; + + /** + * Gets the AvailabilitySetsClient object to access its operations. + * + * @return the AvailabilitySetsClient object. + */ + public AvailabilitySetsClient getAvailabilitySets() { + return this.availabilitySets; + } + + /** + * The CloudsClient object to access its operations. + */ private final CloudsClient clouds; /** * Gets the CloudsClient object to access its operations. - * + * * @return the CloudsClient object. */ public CloudsClient getClouds() { return this.clouds; } - /** The VirtualNetworksClient object to access its operations. */ + /** + * The VirtualMachineTemplatesClient object to access its operations. + */ + private final VirtualMachineTemplatesClient virtualMachineTemplates; + + /** + * Gets the VirtualMachineTemplatesClient object to access its operations. + * + * @return the VirtualMachineTemplatesClient object. + */ + public VirtualMachineTemplatesClient getVirtualMachineTemplates() { + return this.virtualMachineTemplates; + } + + /** + * The VirtualNetworksClient object to access its operations. + */ private final VirtualNetworksClient virtualNetworks; /** * Gets the VirtualNetworksClient object to access its operations. - * + * * @return the VirtualNetworksClient object. */ public VirtualNetworksClient getVirtualNetworks() { return this.virtualNetworks; } - /** The VirtualMachinesClient object to access its operations. */ - private final VirtualMachinesClient virtualMachines; - /** - * Gets the VirtualMachinesClient object to access its operations. - * - * @return the VirtualMachinesClient object. + * The VmmServersClient object to access its operations. */ - public VirtualMachinesClient getVirtualMachines() { - return this.virtualMachines; - } - - /** The VirtualMachineTemplatesClient object to access its operations. */ - private final VirtualMachineTemplatesClient virtualMachineTemplates; + private final VmmServersClient vmmServers; /** - * Gets the VirtualMachineTemplatesClient object to access its operations. - * - * @return the VirtualMachineTemplatesClient object. + * Gets the VmmServersClient object to access its operations. + * + * @return the VmmServersClient object. */ - public VirtualMachineTemplatesClient getVirtualMachineTemplates() { - return this.virtualMachineTemplates; + public VmmServersClient getVmmServers() { + return this.vmmServers; } - /** The AvailabilitySetsClient object to access its operations. */ - private final AvailabilitySetsClient availabilitySets; - /** - * Gets the AvailabilitySetsClient object to access its operations. - * - * @return the AvailabilitySetsClient object. + * The InventoryItemsClient object to access its operations. */ - public AvailabilitySetsClient getAvailabilitySets() { - return this.availabilitySets; - } - - /** The InventoryItemsClient object to access its operations. */ private final InventoryItemsClient inventoryItems; /** * Gets the InventoryItemsClient object to access its operations. - * + * * @return the InventoryItemsClient object. */ public InventoryItemsClient getInventoryItems() { @@ -213,41 +273,37 @@ public InventoryItemsClient getInventoryItems() { /** * Initializes an instance of ScvmmClient 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. * @param environment The Azure environment. - * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000). + * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - ScvmmClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + ScvmmClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-06-05-preview"; - this.vmmServers = new VmmServersClientImpl(this); + this.apiVersion = "2023-10-07"; + this.virtualMachineInstances = new VirtualMachineInstancesClientImpl(this); + this.guestAgents = new GuestAgentsClientImpl(this); + this.vmInstanceHybridIdentityMetadatas = new VmInstanceHybridIdentityMetadatasClientImpl(this); this.operations = new OperationsClientImpl(this); + this.availabilitySets = new AvailabilitySetsClientImpl(this); this.clouds = new CloudsClientImpl(this); - this.virtualNetworks = new VirtualNetworksClientImpl(this); - this.virtualMachines = new VirtualMachinesClientImpl(this); this.virtualMachineTemplates = new VirtualMachineTemplatesClientImpl(this); - this.availabilitySets = new AvailabilitySetsClientImpl(this); + this.virtualNetworks = new VirtualNetworksClientImpl(this); + this.vmmServers = new VmmServersClientImpl(this); this.inventoryItems = new InventoryItemsClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -256,20 +312,17 @@ 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. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -279,26 +332,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -311,19 +353,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, + SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineImpl.java deleted file mode 100644 index c12cf684e0a54..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineImpl.java +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.scvmm.models.AvailabilitySetListItem; -import com.azure.resourcemanager.scvmm.models.Checkpoint; -import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.HardwareProfile; -import com.azure.resourcemanager.scvmm.models.NetworkProfile; -import com.azure.resourcemanager.scvmm.models.OsProfile; -import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; -import com.azure.resourcemanager.scvmm.models.StorageProfile; -import com.azure.resourcemanager.scvmm.models.VirtualMachine; -import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineUpdate; -import com.azure.resourcemanager.scvmm.models.VirtualMachineUpdateProperties; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class VirtualMachineImpl implements VirtualMachine, VirtualMachine.Definition, VirtualMachine.Update { - private VirtualMachineInner innerObject; - - private final com.azure.resourcemanager.scvmm.ScvmmManager 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 ExtendedLocation extendedLocation() { - return this.innerModel().extendedLocation(); - } - - public String inventoryItemId() { - return this.innerModel().inventoryItemId(); - } - - public String vmmServerId() { - return this.innerModel().vmmServerId(); - } - - public String cloudId() { - return this.innerModel().cloudId(); - } - - public String templateId() { - return this.innerModel().templateId(); - } - - public String checkpointType() { - return this.innerModel().checkpointType(); - } - - public List checkpoints() { - List inner = this.innerModel().checkpoints(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List availabilitySets() { - List inner = this.innerModel().availabilitySets(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OsProfile osProfile() { - return this.innerModel().osProfile(); - } - - public HardwareProfile hardwareProfile() { - return this.innerModel().hardwareProfile(); - } - - public NetworkProfile networkProfile() { - return this.innerModel().networkProfile(); - } - - public StorageProfile storageProfile() { - return this.innerModel().storageProfile(); - } - - public String vmName() { - return this.innerModel().vmName(); - } - - public String uuid() { - return this.innerModel().uuid(); - } - - public Integer generation() { - return this.innerModel().generation(); - } - - public String powerState() { - return this.innerModel().powerState(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public VirtualMachineInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.scvmm.ScvmmManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String virtualMachineName; - - private VirtualMachineUpdate updateBody; - - public VirtualMachineImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public VirtualMachine create() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .createOrUpdate(resourceGroupName, virtualMachineName, this.innerModel(), Context.NONE); - return this; - } - - public VirtualMachine create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .createOrUpdate(resourceGroupName, virtualMachineName, this.innerModel(), context); - return this; - } - - VirtualMachineImpl(String name, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { - this.innerObject = new VirtualMachineInner(); - this.serviceManager = serviceManager; - this.virtualMachineName = name; - } - - public VirtualMachineImpl update() { - this.updateBody = new VirtualMachineUpdate(); - return this; - } - - public VirtualMachine apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .update(resourceGroupName, virtualMachineName, updateBody, Context.NONE); - return this; - } - - public VirtualMachine apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .update(resourceGroupName, virtualMachineName, updateBody, context); - return this; - } - - VirtualMachineImpl(VirtualMachineInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.virtualMachineName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachines"); - } - - public VirtualMachine refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, Context.NONE) - .getValue(); - return this; - } - - public VirtualMachine refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachines() - .getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context) - .getValue(); - return this; - } - - public void stop(StopVirtualMachineOptions body) { - serviceManager.virtualMachines().stop(resourceGroupName, virtualMachineName, body); - } - - public void stop() { - serviceManager.virtualMachines().stop(resourceGroupName, virtualMachineName); - } - - public void stop(StopVirtualMachineOptions body, Context context) { - serviceManager.virtualMachines().stop(resourceGroupName, virtualMachineName, body, context); - } - - public void start() { - serviceManager.virtualMachines().start(resourceGroupName, virtualMachineName); - } - - public void start(Context context) { - serviceManager.virtualMachines().start(resourceGroupName, virtualMachineName, context); - } - - public void restart() { - serviceManager.virtualMachines().restart(resourceGroupName, virtualMachineName); - } - - public void restart(Context context) { - serviceManager.virtualMachines().restart(resourceGroupName, virtualMachineName, context); - } - - public void createCheckpoint(VirtualMachineCreateCheckpoint body) { - serviceManager.virtualMachines().createCheckpoint(resourceGroupName, virtualMachineName, body); - } - - public void createCheckpoint() { - serviceManager.virtualMachines().createCheckpoint(resourceGroupName, virtualMachineName); - } - - public void createCheckpoint(VirtualMachineCreateCheckpoint body, Context context) { - serviceManager.virtualMachines().createCheckpoint(resourceGroupName, virtualMachineName, body, context); - } - - public void deleteCheckpoint(VirtualMachineDeleteCheckpoint body) { - serviceManager.virtualMachines().deleteCheckpoint(resourceGroupName, virtualMachineName, body); - } - - public void deleteCheckpoint() { - serviceManager.virtualMachines().deleteCheckpoint(resourceGroupName, virtualMachineName); - } - - public void deleteCheckpoint(VirtualMachineDeleteCheckpoint body, Context context) { - serviceManager.virtualMachines().deleteCheckpoint(resourceGroupName, virtualMachineName, body, context); - } - - public void restoreCheckpoint(VirtualMachineRestoreCheckpoint body) { - serviceManager.virtualMachines().restoreCheckpoint(resourceGroupName, virtualMachineName, body); - } - - public void restoreCheckpoint() { - serviceManager.virtualMachines().restoreCheckpoint(resourceGroupName, virtualMachineName); - } - - public void restoreCheckpoint(VirtualMachineRestoreCheckpoint body, Context context) { - serviceManager.virtualMachines().restoreCheckpoint(resourceGroupName, virtualMachineName, body, context); - } - - public VirtualMachineImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public VirtualMachineImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public VirtualMachineImpl withExtendedLocation(ExtendedLocation extendedLocation) { - this.innerModel().withExtendedLocation(extendedLocation); - return this; - } - - public VirtualMachineImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateBody.withTags(tags); - return this; - } - } - - public VirtualMachineImpl withInventoryItemId(String inventoryItemId) { - this.innerModel().withInventoryItemId(inventoryItemId); - return this; - } - - public VirtualMachineImpl withVmmServerId(String vmmServerId) { - this.innerModel().withVmmServerId(vmmServerId); - return this; - } - - public VirtualMachineImpl withCloudId(String cloudId) { - this.innerModel().withCloudId(cloudId); - return this; - } - - public VirtualMachineImpl withTemplateId(String templateId) { - this.innerModel().withTemplateId(templateId); - return this; - } - - public VirtualMachineImpl withCheckpointType(String checkpointType) { - this.innerModel().withCheckpointType(checkpointType); - return this; - } - - public VirtualMachineImpl withCheckpoints(List checkpoints) { - this.innerModel().withCheckpoints(checkpoints); - return this; - } - - public VirtualMachineImpl withAvailabilitySets(List availabilitySets) { - this.innerModel().withAvailabilitySets(availabilitySets); - return this; - } - - public VirtualMachineImpl withOsProfile(OsProfile osProfile) { - this.innerModel().withOsProfile(osProfile); - return this; - } - - public VirtualMachineImpl withHardwareProfile(HardwareProfile hardwareProfile) { - this.innerModel().withHardwareProfile(hardwareProfile); - return this; - } - - public VirtualMachineImpl withNetworkProfile(NetworkProfile networkProfile) { - this.innerModel().withNetworkProfile(networkProfile); - return this; - } - - public VirtualMachineImpl withStorageProfile(StorageProfile storageProfile) { - this.innerModel().withStorageProfile(storageProfile); - return this; - } - - public VirtualMachineImpl withVmName(String vmName) { - this.innerModel().withVmName(vmName); - return this; - } - - public VirtualMachineImpl withUuid(String uuid) { - this.innerModel().withUuid(uuid); - return this; - } - - public VirtualMachineImpl withGeneration(Integer generation) { - this.innerModel().withGeneration(generation); - return this; - } - - public VirtualMachineImpl withProperties(VirtualMachineUpdateProperties properties) { - this.updateBody.withProperties(properties); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstanceImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstanceImpl.java new file mode 100644 index 0000000000000..6a901cf73f14d --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstanceImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.scvmm.models.ExtendedLocation; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstance; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceProperties; + +public final class VirtualMachineInstanceImpl implements VirtualMachineInstance { + private VirtualMachineInstanceInner innerObject; + + private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; + + VirtualMachineInstanceImpl(VirtualMachineInstanceInner innerObject, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public VirtualMachineInstanceProperties properties() { + return this.innerModel().properties(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VirtualMachineInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.scvmm.ScvmmManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstancesClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstancesClientImpl.java new file mode 100644 index 0000000000000..cb9326201677f --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstancesClientImpl.java @@ -0,0 +1,2253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.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.Post; +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.scvmm.fluent.VirtualMachineInstancesClient; +import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; +import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; +import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceListResult; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceUpdate; +import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; +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 VirtualMachineInstancesClient. + */ +public final class VirtualMachineInstancesClientImpl implements VirtualMachineInstancesClient { + /** + * The proxy service used to perform REST calls. + */ + private final VirtualMachineInstancesService service; + + /** + * The service client containing this operation class. + */ + private final ScvmmClientImpl client; + + /** + * Initializes an instance of VirtualMachineInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachineInstancesClientImpl(ScvmmClientImpl client) { + this.service = RestProxy.create(VirtualMachineInstancesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ScvmmClientVirtualMachineInstances to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ScvmmClientVirtualMa") + public interface VirtualMachineInstancesService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") VirtualMachineInstanceInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") VirtualMachineInstanceUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @QueryParam("force") Boolean force, + @QueryParam("deleteFromHost") Boolean deleteFromHost, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createCheckpoint(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") VirtualMachineCreateCheckpoint body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteCheckpoint(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") VirtualMachineDeleteCheckpoint body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") Object body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restoreCheckpoint(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") VirtualMachineRestoreCheckpoint body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") Object body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @BodyParam("application/json") StopVirtualMachineOptions body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a VirtualMachineInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + 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())); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VirtualMachineInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a VirtualMachineInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VirtualMachineInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a VirtualMachineInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VirtualMachineInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri 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(), resourceUri, accept, context); + } + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceUri, + VirtualMachineInstanceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceUri, + VirtualMachineInstanceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, resource, + accept, context); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> + beginCreateOrUpdateAsync(String resourceUri, VirtualMachineInstanceInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineInstanceInner.class, VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> + beginCreateOrUpdateAsync(String resourceUri, VirtualMachineInstanceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceUri, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineInstanceInner.class, VirtualMachineInstanceInner.class, + context); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> + beginCreateOrUpdate(String resourceUri, VirtualMachineInstanceInner resource) { + return this.beginCreateOrUpdateAsync(resourceUri, resource).getSyncPoller(); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> + beginCreateOrUpdate(String resourceUri, VirtualMachineInstanceInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceUri, resource, context).getSyncPoller(); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceUri, + VirtualMachineInstanceInner resource) { + return beginCreateOrUpdateAsync(resourceUri, resource).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceUri, + VirtualMachineInstanceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceUri, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner createOrUpdate(String resourceUri, VirtualMachineInstanceInner resource) { + return createOrUpdateAsync(resourceUri, resource).block(); + } + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner createOrUpdate(String resourceUri, VirtualMachineInstanceInner resource, + Context context) { + return createOrUpdateAsync(resourceUri, resource, context).block(); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceUri, + VirtualMachineInstanceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceUri, + VirtualMachineInstanceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, properties, accept, + context); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> + beginUpdateAsync(String resourceUri, VirtualMachineInstanceUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceUri, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineInstanceInner.class, VirtualMachineInstanceInner.class, + this.client.getContext()); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualMachineInstanceInner> + beginUpdateAsync(String resourceUri, VirtualMachineInstanceUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceUri, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineInstanceInner.class, VirtualMachineInstanceInner.class, + context); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> + beginUpdate(String resourceUri, VirtualMachineInstanceUpdate properties) { + return this.beginUpdateAsync(resourceUri, properties).getSyncPoller(); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualMachineInstanceInner> + beginUpdate(String resourceUri, VirtualMachineInstanceUpdate properties, Context context) { + return this.beginUpdateAsync(resourceUri, properties, context).getSyncPoller(); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceUri, VirtualMachineInstanceUpdate properties) { + return beginUpdateAsync(resourceUri, properties).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceUri, VirtualMachineInstanceUpdate properties, + Context context) { + return beginUpdateAsync(resourceUri, properties, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner update(String resourceUri, VirtualMachineInstanceUpdate properties) { + return updateAsync(resourceUri, properties).block(); + } + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualMachineInstanceInner update(String resourceUri, VirtualMachineInstanceUpdate properties, + Context context) { + return updateAsync(resourceUri, properties, context).block(); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceUri, Boolean force, + Boolean deleteFromHost) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + force, deleteFromHost, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceUri, Boolean force, + Boolean deleteFromHost, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri 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(), resourceUri, force, + deleteFromHost, accept, context); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri, Boolean force, + Boolean deleteFromHost) { + Mono>> mono = deleteWithResponseAsync(resourceUri, force, deleteFromHost); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri) { + final Boolean force = null; + final Boolean deleteFromHost = null; + Mono>> mono = deleteWithResponseAsync(resourceUri, force, deleteFromHost); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceUri, Boolean force, + Boolean deleteFromHost, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceUri, force, deleteFromHost, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri) { + final Boolean force = null; + final Boolean deleteFromHost = null; + return this.beginDeleteAsync(resourceUri, force, deleteFromHost).getSyncPoller(); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceUri, Boolean force, Boolean deleteFromHost, + Context context) { + return this.beginDeleteAsync(resourceUri, force, deleteFromHost, context).getSyncPoller(); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri, Boolean force, Boolean deleteFromHost) { + return beginDeleteAsync(resourceUri, force, deleteFromHost).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri) { + final Boolean force = null; + final Boolean deleteFromHost = null; + return beginDeleteAsync(resourceUri, force, deleteFromHost).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri, Boolean force, Boolean deleteFromHost, Context context) { + return beginDeleteAsync(resourceUri, force, deleteFromHost, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri) { + final Boolean force = null; + final Boolean deleteFromHost = null; + deleteAsync(resourceUri, force, deleteFromHost).block(); + } + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceUri, Boolean force, Boolean deleteFromHost, Context context) { + deleteAsync(resourceUri, force, deleteFromHost, context).block(); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createCheckpointWithResponseAsync(String resourceUri, + VirtualMachineCreateCheckpoint body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createCheckpoint(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createCheckpointWithResponseAsync(String resourceUri, + VirtualMachineCreateCheckpoint body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createCheckpoint(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, body, + accept, context); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCreateCheckpointAsync(String resourceUri, + VirtualMachineCreateCheckpoint body) { + Mono>> mono = createCheckpointWithResponseAsync(resourceUri, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCreateCheckpointAsync(String resourceUri, + VirtualMachineCreateCheckpoint body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createCheckpointWithResponseAsync(resourceUri, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCreateCheckpoint(String resourceUri, + VirtualMachineCreateCheckpoint body) { + return this.beginCreateCheckpointAsync(resourceUri, body).getSyncPoller(); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCreateCheckpoint(String resourceUri, + VirtualMachineCreateCheckpoint body, Context context) { + return this.beginCreateCheckpointAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createCheckpointAsync(String resourceUri, VirtualMachineCreateCheckpoint body) { + return beginCreateCheckpointAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createCheckpointAsync(String resourceUri, VirtualMachineCreateCheckpoint body, Context context) { + return beginCreateCheckpointAsync(resourceUri, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void createCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body) { + createCheckpointAsync(resourceUri, body).block(); + } + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void createCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body, Context context) { + createCheckpointAsync(resourceUri, body, context).block(); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteCheckpointWithResponseAsync(String resourceUri, + VirtualMachineDeleteCheckpoint body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deleteCheckpoint(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteCheckpointWithResponseAsync(String resourceUri, + VirtualMachineDeleteCheckpoint body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteCheckpoint(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, body, + accept, context); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteCheckpointAsync(String resourceUri, + VirtualMachineDeleteCheckpoint body) { + Mono>> mono = deleteCheckpointWithResponseAsync(resourceUri, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteCheckpointAsync(String resourceUri, + VirtualMachineDeleteCheckpoint body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteCheckpointWithResponseAsync(resourceUri, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteCheckpoint(String resourceUri, + VirtualMachineDeleteCheckpoint body) { + return this.beginDeleteCheckpointAsync(resourceUri, body).getSyncPoller(); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteCheckpoint(String resourceUri, + VirtualMachineDeleteCheckpoint body, Context context) { + return this.beginDeleteCheckpointAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteCheckpointAsync(String resourceUri, VirtualMachineDeleteCheckpoint body) { + return beginDeleteCheckpointAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteCheckpointAsync(String resourceUri, VirtualMachineDeleteCheckpoint body, Context context) { + return beginDeleteCheckpointAsync(resourceUri, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body) { + deleteCheckpointAsync(resourceUri, body).block(); + } + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body, Context context) { + deleteCheckpointAsync(resourceUri, body, context).block(); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceUri, Object body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceUri, Object body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restart(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, body, accept, + context); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceUri, Object body) { + Mono>> mono = restartWithResponseAsync(resourceUri, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceUri, Object body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restartWithResponseAsync(resourceUri, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceUri, Object body) { + return this.beginRestartAsync(resourceUri, body).getSyncPoller(); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceUri, Object body, Context context) { + return this.beginRestartAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceUri, Object body) { + return beginRestartAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceUri, Object body, Context context) { + return beginRestartAsync(resourceUri, body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceUri, Object body) { + restartAsync(resourceUri, body).block(); + } + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceUri, Object body, Context context) { + restartAsync(resourceUri, body, context).block(); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreCheckpointWithResponseAsync(String resourceUri, + VirtualMachineRestoreCheckpoint body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restoreCheckpoint(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreCheckpointWithResponseAsync(String resourceUri, + VirtualMachineRestoreCheckpoint body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restoreCheckpoint(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, body, + accept, context); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestoreCheckpointAsync(String resourceUri, + VirtualMachineRestoreCheckpoint body) { + Mono>> mono = restoreCheckpointWithResponseAsync(resourceUri, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestoreCheckpointAsync(String resourceUri, + VirtualMachineRestoreCheckpoint body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restoreCheckpointWithResponseAsync(resourceUri, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestoreCheckpoint(String resourceUri, + VirtualMachineRestoreCheckpoint body) { + return this.beginRestoreCheckpointAsync(resourceUri, body).getSyncPoller(); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestoreCheckpoint(String resourceUri, + VirtualMachineRestoreCheckpoint body, Context context) { + return this.beginRestoreCheckpointAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreCheckpointAsync(String resourceUri, VirtualMachineRestoreCheckpoint body) { + return beginRestoreCheckpointAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreCheckpointAsync(String resourceUri, VirtualMachineRestoreCheckpoint body, + Context context) { + return beginRestoreCheckpointAsync(resourceUri, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body) { + restoreCheckpointAsync(resourceUri, body).block(); + } + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body, Context context) { + restoreCheckpointAsync(resourceUri, body, context).block(); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceUri, Object body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceUri, Object body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, body, accept, + context); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceUri, Object body) { + Mono>> mono = startWithResponseAsync(resourceUri, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync(String resourceUri, Object body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceUri, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceUri, Object body) { + return this.beginStartAsync(resourceUri, body).getSyncPoller(); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceUri, Object body, Context context) { + return this.beginStartAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceUri, Object body) { + return beginStartAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceUri, Object body, Context context) { + return beginStartAsync(resourceUri, body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceUri, Object body) { + startAsync(resourceUri, body).block(); + } + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceUri, Object body, Context context) { + startAsync(resourceUri, body, context).block(); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceUri, StopVirtualMachineOptions body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String resourceUri, StopVirtualMachineOptions body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, body, accept, context); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync(String resourceUri, StopVirtualMachineOptions body) { + Mono>> mono = stopWithResponseAsync(resourceUri, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync(String resourceUri, StopVirtualMachineOptions body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceUri, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceUri, StopVirtualMachineOptions body) { + return this.beginStopAsync(resourceUri, body).getSyncPoller(); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceUri, StopVirtualMachineOptions body, + Context context) { + return this.beginStopAsync(resourceUri, body, context).getSyncPoller(); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceUri, StopVirtualMachineOptions body) { + return beginStopAsync(resourceUri, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceUri, StopVirtualMachineOptions body, Context context) { + return beginStopAsync(resourceUri, body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceUri, StopVirtualMachineOptions body) { + stopAsync(resourceUri, body).block(); + } + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceUri, StopVirtualMachineOptions body, Context context) { + stopAsync(resourceUri, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VirtualMachineInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VirtualMachineInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstancesImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstancesImpl.java new file mode 100644 index 0000000000000..fa9822ebd0bbc --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineInstancesImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.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.scvmm.fluent.VirtualMachineInstancesClient; +import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInstanceInner; +import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; +import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; +import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstance; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceUpdate; +import com.azure.resourcemanager.scvmm.models.VirtualMachineInstances; +import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; + +public final class VirtualMachineInstancesImpl implements VirtualMachineInstances { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstancesImpl.class); + + private final VirtualMachineInstancesClient innerClient; + + private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; + + public VirtualMachineInstancesImpl(VirtualMachineInstancesClient innerClient, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineInstanceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VirtualMachineInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VirtualMachineInstance get(String resourceUri) { + VirtualMachineInstanceInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance createOrUpdate(String resourceUri, VirtualMachineInstanceInner resource) { + VirtualMachineInstanceInner inner = this.serviceClient().createOrUpdate(resourceUri, resource); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance createOrUpdate(String resourceUri, VirtualMachineInstanceInner resource, + Context context) { + VirtualMachineInstanceInner inner = this.serviceClient().createOrUpdate(resourceUri, resource, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance update(String resourceUri, VirtualMachineInstanceUpdate properties) { + VirtualMachineInstanceInner inner = this.serviceClient().update(resourceUri, properties); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualMachineInstance update(String resourceUri, VirtualMachineInstanceUpdate properties, Context context) { + VirtualMachineInstanceInner inner = this.serviceClient().update(resourceUri, properties, context); + if (inner != null) { + return new VirtualMachineInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceUri) { + this.serviceClient().delete(resourceUri); + } + + public void delete(String resourceUri, Boolean force, Boolean deleteFromHost, Context context) { + this.serviceClient().delete(resourceUri, force, deleteFromHost, context); + } + + public void createCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body) { + this.serviceClient().createCheckpoint(resourceUri, body); + } + + public void createCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body, Context context) { + this.serviceClient().createCheckpoint(resourceUri, body, context); + } + + public void deleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body) { + this.serviceClient().deleteCheckpoint(resourceUri, body); + } + + public void deleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body, Context context) { + this.serviceClient().deleteCheckpoint(resourceUri, body, context); + } + + public void restart(String resourceUri, Object body) { + this.serviceClient().restart(resourceUri, body); + } + + public void restart(String resourceUri, Object body, Context context) { + this.serviceClient().restart(resourceUri, body, context); + } + + public void restoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body) { + this.serviceClient().restoreCheckpoint(resourceUri, body); + } + + public void restoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body, Context context) { + this.serviceClient().restoreCheckpoint(resourceUri, body, context); + } + + public void start(String resourceUri, Object body) { + this.serviceClient().start(resourceUri, body); + } + + public void start(String resourceUri, Object body, Context context) { + this.serviceClient().start(resourceUri, body, context); + } + + public void stop(String resourceUri, StopVirtualMachineOptions body) { + this.serviceClient().stop(resourceUri, body); + } + + public void stop(String resourceUri, StopVirtualMachineOptions body, Context context) { + this.serviceClient().stop(resourceUri, body, context); + } + + private VirtualMachineInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.scvmm.ScvmmManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplateImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplateImpl.java index 24907810be13f..f9de1d2f5a9ba 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplateImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplateImpl.java @@ -8,17 +8,11 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineTemplateInner; -import com.azure.resourcemanager.scvmm.models.DynamicMemoryEnabled; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.IsCustomizable; -import com.azure.resourcemanager.scvmm.models.LimitCpuForMigration; -import com.azure.resourcemanager.scvmm.models.NetworkInterfaces; -import com.azure.resourcemanager.scvmm.models.OsType; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; -import com.azure.resourcemanager.scvmm.models.VirtualDisk; import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplate; +import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateProperties; +import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateTagsUpdate; import java.util.Collections; -import java.util.List; import java.util.Map; public final class VirtualMachineTemplateImpl @@ -52,94 +46,16 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); + public VirtualMachineTemplateProperties properties() { + return this.innerModel().properties(); } public ExtendedLocation extendedLocation() { return this.innerModel().extendedLocation(); } - public String inventoryItemId() { - return this.innerModel().inventoryItemId(); - } - - public String uuid() { - return this.innerModel().uuid(); - } - - public String vmmServerId() { - return this.innerModel().vmmServerId(); - } - - public OsType osType() { - return this.innerModel().osType(); - } - - public String osName() { - return this.innerModel().osName(); - } - - public String computerName() { - return this.innerModel().computerName(); - } - - public Integer memoryMB() { - return this.innerModel().memoryMB(); - } - - public Integer cpuCount() { - return this.innerModel().cpuCount(); - } - - public LimitCpuForMigration limitCpuForMigration() { - return this.innerModel().limitCpuForMigration(); - } - - public DynamicMemoryEnabled dynamicMemoryEnabled() { - return this.innerModel().dynamicMemoryEnabled(); - } - - public IsCustomizable isCustomizable() { - return this.innerModel().isCustomizable(); - } - - public Integer dynamicMemoryMaxMB() { - return this.innerModel().dynamicMemoryMaxMB(); - } - - public Integer dynamicMemoryMinMB() { - return this.innerModel().dynamicMemoryMinMB(); - } - - public String isHighlyAvailable() { - return this.innerModel().isHighlyAvailable(); - } - - public Integer generation() { - return this.innerModel().generation(); - } - - public List networkInterfaces() { - List inner = this.innerModel().networkInterfaces(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List disks() { - List inner = this.innerModel().disks(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -150,6 +66,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public VirtualMachineTemplateInner innerModel() { return this.innerObject; } @@ -162,7 +82,7 @@ private com.azure.resourcemanager.scvmm.ScvmmManager manager() { private String virtualMachineTemplateName; - private ResourcePatch updateBody; + private VirtualMachineTemplateTagsUpdate updateProperties; public VirtualMachineTemplateImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -170,20 +90,14 @@ public VirtualMachineTemplateImpl withExistingResourceGroup(String resourceGroup } public VirtualMachineTemplate create() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachineTemplates() - .createOrUpdate(resourceGroupName, virtualMachineTemplateName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getVirtualMachineTemplates().createOrUpdate(resourceGroupName, + virtualMachineTemplateName, this.innerModel(), Context.NONE); return this; } public VirtualMachineTemplate create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachineTemplates() - .createOrUpdate(resourceGroupName, virtualMachineTemplateName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getVirtualMachineTemplates().createOrUpdate(resourceGroupName, + virtualMachineTemplateName, this.innerModel(), context); return this; } @@ -194,53 +108,40 @@ public VirtualMachineTemplate create(Context context) { } public VirtualMachineTemplateImpl update() { - this.updateBody = new ResourcePatch(); + this.updateProperties = new VirtualMachineTemplateTagsUpdate(); return this; } public VirtualMachineTemplate apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachineTemplates() - .update(resourceGroupName, virtualMachineTemplateName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient().getVirtualMachineTemplates().update(resourceGroupName, + virtualMachineTemplateName, updateProperties, Context.NONE); return this; } public VirtualMachineTemplate apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachineTemplates() - .update(resourceGroupName, virtualMachineTemplateName, updateBody, context); + this.innerObject = serviceManager.serviceClient().getVirtualMachineTemplates().update(resourceGroupName, + virtualMachineTemplateName, updateProperties, context); return this; } - VirtualMachineTemplateImpl( - VirtualMachineTemplateInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + VirtualMachineTemplateImpl(VirtualMachineTemplateInner innerObject, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.virtualMachineTemplateName = Utils.getValueFromIdByName(innerObject.id(), "virtualMachineTemplates"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualMachineTemplateName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualMachineTemplates"); } public VirtualMachineTemplate refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachineTemplates() - .getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getVirtualMachineTemplates() + .getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, Context.NONE).getValue(); return this; } public VirtualMachineTemplate refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualMachineTemplates() - .getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getVirtualMachineTemplates() + .getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, context).getValue(); return this; } @@ -264,23 +165,13 @@ public VirtualMachineTemplateImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } else { - this.updateBody.withTags(tags); + this.updateProperties.withTags(tags); return this; } } - public VirtualMachineTemplateImpl withInventoryItemId(String inventoryItemId) { - this.innerModel().withInventoryItemId(inventoryItemId); - return this; - } - - public VirtualMachineTemplateImpl withUuid(String uuid) { - this.innerModel().withUuid(uuid); - return this; - } - - public VirtualMachineTemplateImpl withVmmServerId(String vmmServerId) { - this.innerModel().withVmmServerId(vmmServerId); + public VirtualMachineTemplateImpl withProperties(VirtualMachineTemplateProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplatesClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplatesClientImpl.java index e444c19a89501..8514e22c689bb 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplatesClientImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplatesClientImpl.java @@ -34,1018 +34,816 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.scvmm.fluent.VirtualMachineTemplatesClient; import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineTemplateInner; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateListResult; +import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateTagsUpdate; 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 VirtualMachineTemplatesClient. */ +/** + * An instance of this class provides access to all the operations defined in VirtualMachineTemplatesClient. + */ public final class VirtualMachineTemplatesClientImpl implements VirtualMachineTemplatesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final VirtualMachineTemplatesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ScvmmClientImpl client; /** * Initializes an instance of VirtualMachineTemplatesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ VirtualMachineTemplatesClientImpl(ScvmmClientImpl client) { - this.service = - RestProxy - .create(VirtualMachineTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(VirtualMachineTemplatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ScvmmClientVirtualMachineTemplates to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for ScvmmClientVirtualMachineTemplates to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ScvmmClientVirtualMa") - private interface VirtualMachineTemplatesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachineTemplates/{virtualMachineTemplateName}") - @ExpectedResponses({200}) + public interface VirtualMachineTemplatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualMachineTemplates") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineTemplateName") String virtualMachineTemplateName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachineTemplates/{virtualMachineTemplateName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineTemplateName") String virtualMachineTemplateName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualMachineTemplateInner body, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachineTemplates/{virtualMachineTemplateName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("virtualMachineTemplateName") String virtualMachineTemplateName, - @QueryParam("api-version") String apiVersion, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachineTemplates/{virtualMachineTemplateName}") - @ExpectedResponses({200, 201, 202}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("virtualMachineTemplateName") String virtualMachineTemplateName, - @BodyParam("application/json") ResourcePatch body, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") VirtualMachineTemplateInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachineTemplates") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("virtualMachineTemplateName") String virtualMachineTemplateName, + @BodyParam("application/json") VirtualMachineTemplateTagsUpdate properties, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualMachineTemplates") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("force") Boolean force, + @PathParam("virtualMachineTemplateName") String virtualMachineTemplateName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VirtualMachineTemplates in a 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 the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a VirtualMachineTemplate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualMachineTemplateName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (virtualMachineTemplateName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineTemplateName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineTemplateName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); } /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * List of VirtualMachineTemplates in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a VirtualMachineTemplate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualMachineTemplateName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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 (virtualMachineTemplateName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineTemplateName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineTemplateName, - this.client.getApiVersion(), - accept, - context); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VirtualMachineTemplates in a 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 the VirtualMachineTemplates resource definition on successful completion of {@link Mono}. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String virtualMachineTemplateName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineTemplateName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * List of VirtualMachineTemplates in a subscription. + * + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName) { - return getByResourceGroupAsync(resourceGroupName, virtualMachineTemplateName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * List of VirtualMachineTemplates in a 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 the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List of VirtualMachineTemplates in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachineTemplates resource definition along with {@link Response}. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineTemplateName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineTemplateName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * List of VirtualMachineTemplates in a 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 the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a VirtualMachineTemplate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body) { + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (virtualMachineTemplateName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineTemplateName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineTemplateName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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())); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * List of VirtualMachineTemplates in a 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 the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a VirtualMachineTemplate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String virtualMachineTemplateName, - VirtualMachineTemplateInner body, - Context context) { + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.")); + 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 (virtualMachineTemplateName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineTemplateName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineTemplateName, - this.client.getApiVersion(), - body, - accept, - context); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * List of VirtualMachineTemplates in a 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 the {@link PollerFlux} for polling of the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineTemplateInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineTemplateInner.class, - VirtualMachineTemplateInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * List of VirtualMachineTemplates in a 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 the {@link PollerFlux} for polling of the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineTemplateInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String virtualMachineTemplateName, - VirtualMachineTemplateInner body, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineTemplateInner.class, - VirtualMachineTemplateInner.class, - context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * List of VirtualMachineTemplates in a 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 the {@link SyncPoller} for polling of the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineTemplateInner> beginCreateOrUpdate( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. + * List of VirtualMachineTemplates in a 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 the {@link SyncPoller} for polling of the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineTemplateInner> beginCreateOrUpdate( - String resourceGroupName, - String virtualMachineTemplateName, - VirtualMachineTemplateInner body, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachineTemplates resource definition on successful completion of {@link Mono}. + * @return the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String virtualMachineTemplateName) { + 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 (virtualMachineTemplateName == null) { + return Mono.error( + new IllegalArgumentException("Parameter virtualMachineTemplateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualMachineTemplateName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachineTemplates resource definition on successful completion of {@link Mono}. + * @return the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String virtualMachineTemplateName, - VirtualMachineTemplateInner body, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String virtualMachineTemplateName, 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 (virtualMachineTemplateName == null) { + return Mono.error( + new IllegalArgumentException("Parameter virtualMachineTemplateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualMachineTemplateName, accept, context); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachineTemplates resource definition. + * @return the VirtualMachineTemplates resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineTemplateInner createOrUpdate( - String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner body) { - return createOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, body).block(); + private Mono getByResourceGroupAsync(String resourceGroupName, + String virtualMachineTemplateName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineTemplateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Onboards the ScVmm VM Template as an Azure VM Template resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VirtualMachineTemplates resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualMachineTemplateName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineTemplateName, context).block(); + } + + /** + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineTemplateInner createOrUpdate( - String resourceGroupName, - String virtualMachineTemplateName, - VirtualMachineTemplateInner body, - Context context) { - return createOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, body, context).block(); + public VirtualMachineTemplateInner getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, Context.NONE).getValue(); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VirtualMachineTemplates resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualMachineTemplateName, Boolean force) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String virtualMachineTemplateName, VirtualMachineTemplateInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (virtualMachineTemplateName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineTemplateName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter virtualMachineTemplateName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineTemplateName, - this.client.getApiVersion(), - force, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualMachineTemplateName, resource, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String virtualMachineTemplateName, VirtualMachineTemplateInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (virtualMachineTemplateName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineTemplateName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter virtualMachineTemplateName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineTemplateName, - this.client.getApiVersion(), - force, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualMachineTemplateName, resource, accept, context); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualMachineTemplateName, Boolean force) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualMachineTemplateName, force); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, VirtualMachineTemplateInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineTemplateInner.class, VirtualMachineTemplateInner.class, + this.client.getContext()); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context) { + private PollerFlux, VirtualMachineTemplateInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner resource, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualMachineTemplateName, force, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineTemplateInner.class, VirtualMachineTemplateInner.class, + context); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineTemplateName, Boolean force) { - return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force).getSyncPoller(); + public SyncPoller, VirtualMachineTemplateInner> beginCreateOrUpdate( + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, resource).getSyncPoller(); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force, context).getSyncPoller(); - } - - /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineTemplateName, Boolean force) { - return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force) - .last() - .flatMap(this.client::getLroFinalResultOrError); + public SyncPoller, VirtualMachineTemplateInner> beginCreateOrUpdate( + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateInner resource, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, resource, context) + .getSyncPoller(); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 VirtualMachineTemplates resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineTemplateName) { - final Boolean force = null; - return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, + String virtualMachineTemplateName, VirtualMachineTemplateInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the VirtualMachineTemplates resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, + String virtualMachineTemplateName, VirtualMachineTemplateInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force) { - deleteAsync(resourceGroupName, virtualMachineTemplateName, force).block(); - } - - /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineTemplateName) { - final Boolean force = null; - deleteAsync(resourceGroupName, virtualMachineTemplateName, force).block(); + public VirtualMachineTemplateInner createOrUpdate(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateInner resource) { + return createOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, resource).block(); } /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm VM Template as an Azure VM Template resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context) { - deleteAsync(resourceGroupName, virtualMachineTemplateName, force, context).block(); + public VirtualMachineTemplateInner createOrUpdate(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualMachineTemplateName, resource, context).block(); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String virtualMachineTemplateName, VirtualMachineTemplateTagsUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (virtualMachineTemplateName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineTemplateName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter virtualMachineTemplateName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineTemplateName, - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualMachineTemplateName, properties, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualMachineTemplates resource definition along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String virtualMachineTemplateName, VirtualMachineTemplateTagsUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (virtualMachineTemplateName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter virtualMachineTemplateName is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter virtualMachineTemplateName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineTemplateName, - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, virtualMachineTemplateName, properties, accept, context); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1053,25 +851,20 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualMachineTemplateInner> beginUpdateAsync( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineTemplateInner.class, - VirtualMachineTemplateInner.class, - this.client.getContext()); + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateTagsUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineTemplateInner.class, VirtualMachineTemplateInner.class, + this.client.getContext()); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1080,26 +873,22 @@ private PollerFlux, VirtualMachineTempla */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, VirtualMachineTemplateInner> beginUpdateAsync( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context) { + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateTagsUpdate properties, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, body, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineTemplateInner.class, - VirtualMachineTemplateInner.class, - context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, virtualMachineTemplateName, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualMachineTemplateInner.class, VirtualMachineTemplateInner.class, + context); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1107,16 +896,16 @@ private PollerFlux, VirtualMachineTempla */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualMachineTemplateInner> beginUpdate( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, virtualMachineTemplateName, body).getSyncPoller(); + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, virtualMachineTemplateName, properties).getSyncPoller(); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1125,35 +914,36 @@ public SyncPoller, VirtualMachineTemplat */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VirtualMachineTemplateInner> beginUpdate( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, virtualMachineTemplateName, body, context).getSyncPoller(); + String resourceGroupName, String virtualMachineTemplateName, VirtualMachineTemplateTagsUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, virtualMachineTemplateName, properties, context) + .getSyncPoller(); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualMachineTemplates resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, virtualMachineTemplateName, body) - .last() + private Mono updateAsync(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, virtualMachineTemplateName, properties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1161,36 +951,35 @@ private Mono updateAsync( * @return the VirtualMachineTemplates resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, virtualMachineTemplateName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, virtualMachineTemplateName, properties, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineTemplateInner update( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body) { - return updateAsync(resourceGroupName, virtualMachineTemplateName, body).block(); + public VirtualMachineTemplateInner update(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateTagsUpdate properties) { + return updateAsync(resourceGroupName, virtualMachineTemplateName, properties).block(); } /** * Updates the VirtualMachineTemplate resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param body VirtualMachineTemplates patch details. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1198,467 +987,382 @@ public VirtualMachineTemplateInner update( * @return the VirtualMachineTemplates resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineTemplateInner update( - String resourceGroupName, String virtualMachineTemplateName, ResourcePatch body, Context context) { - return updateAsync(resourceGroupName, virtualMachineTemplateName, body, context).block(); + public VirtualMachineTemplateInner update(String resourceGroupName, String virtualMachineTemplateName, + VirtualMachineTemplateTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, virtualMachineTemplateName, properties, context).block(); } /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String virtualMachineTemplateName, Boolean force) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (virtualMachineTemplateName == null) { + return Mono.error( + new IllegalArgumentException("Parameter virtualMachineTemplateName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, force, virtualMachineTemplateName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String virtualMachineTemplateName, Boolean force, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (virtualMachineTemplateName == null) { + return Mono.error( + new IllegalArgumentException("Parameter virtualMachineTemplateName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, force, virtualMachineTemplateName, accept, context); } /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String virtualMachineTemplateName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualMachineTemplateName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String virtualMachineTemplateName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualMachineTemplateName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String virtualMachineTemplateName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualMachineTemplateName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineTemplateName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force).getSyncPoller(); } /** - * List of VirtualMachineTemplates in a subscription. - * + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualMachineTemplateName, + Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force, context).getSyncPoller(); } /** - * List of VirtualMachineTemplates in a subscription. - * - * @param context The context to associate with this operation. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + private Mono deleteAsync(String resourceGroupName, String virtualMachineTemplateName, Boolean force) { + return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VirtualMachineTemplates in a subscription. - * + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualMachineTemplateName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VirtualMachineTemplates in a subscription. - * + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualMachineTemplateName, Boolean force, + Context context) { + return beginDeleteAsync(resourceGroupName, virtualMachineTemplateName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VirtualMachineTemplates in a subscription. - * + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualMachineTemplateName) { + final Boolean force = null; + deleteAsync(resourceGroupName, virtualMachineTemplateName, force).block(); } /** - * List of VirtualMachineTemplates in a subscription. - * + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context) { + deleteAsync(resourceGroupName, virtualMachineTemplateName, force, context).block(); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the response of a VirtualMachineTemplate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listBySubscriptionNext(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 nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the response of a VirtualMachineTemplate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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 - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the response of a VirtualMachineTemplate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the response of a VirtualMachineTemplate list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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 - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplatesImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplatesImpl.java index 3bf7cf2382869..047824e709644 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplatesImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachineTemplatesImpl.java @@ -21,41 +21,55 @@ public final class VirtualMachineTemplatesImpl implements VirtualMachineTemplate private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; - public VirtualMachineTemplatesImpl( - VirtualMachineTemplatesClient innerClient, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + public VirtualMachineTemplatesImpl(VirtualMachineTemplatesClient innerClient, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public VirtualMachineTemplate getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName) { - VirtualMachineTemplateInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, virtualMachineTemplateName); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualMachineTemplateName, Context context) { + Response inner = this.serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, context); if (inner != null) { - return new VirtualMachineTemplateImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VirtualMachineTemplateImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineTemplateName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, context); + public VirtualMachineTemplate getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName) { + VirtualMachineTemplateInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, virtualMachineTemplateName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VirtualMachineTemplateImpl(inner.getValue(), this.manager())); + return new VirtualMachineTemplateImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force) { - this.serviceClient().delete(resourceGroupName, virtualMachineTemplateName, force); - } - public void delete(String resourceGroupName, String virtualMachineTemplateName) { this.serviceClient().delete(resourceGroupName, virtualMachineTemplateName); } @@ -64,114 +78,60 @@ public void delete(String resourceGroupName, String virtualMachineTemplateName, this.serviceClient().delete(resourceGroupName, virtualMachineTemplateName, force, context); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager())); - } - public VirtualMachineTemplate 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineTemplateName = Utils.getValueFromIdByName(id, "virtualMachineTemplates"); + String virtualMachineTemplateName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachineTemplates"); if (virtualMachineTemplateName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'virtualMachineTemplates'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachineTemplates'.", id))); } - return this - .getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, Context.NONE) + return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, Context.NONE) .getValue(); } 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineTemplateName = Utils.getValueFromIdByName(id, "virtualMachineTemplates"); + String virtualMachineTemplateName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachineTemplates"); if (virtualMachineTemplateName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'virtualMachineTemplates'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachineTemplates'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineTemplateName, context); } public void deleteById(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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineTemplateName = Utils.getValueFromIdByName(id, "virtualMachineTemplates"); + String virtualMachineTemplateName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachineTemplates"); if (virtualMachineTemplateName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'virtualMachineTemplates'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachineTemplates'.", id))); } Boolean localForce = null; this.delete(resourceGroupName, virtualMachineTemplateName, localForce, Context.NONE); } public void deleteByIdWithResponse(String id, Boolean force, 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualMachineTemplateName = Utils.getValueFromIdByName(id, "virtualMachineTemplates"); + String virtualMachineTemplateName = ResourceManagerUtils.getValueFromIdByName(id, "virtualMachineTemplates"); if (virtualMachineTemplateName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'virtualMachineTemplates'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachineTemplates'.", id))); } this.delete(resourceGroupName, virtualMachineTemplateName, force, context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachinesClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachinesClientImpl.java deleted file mode 100644 index c94d428993eb7..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachinesClientImpl.java +++ /dev/null @@ -1,3353 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.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.Post; -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.scvmm.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; -import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineListResult; -import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineUpdate; -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 VirtualMachinesClient. */ -public final class VirtualMachinesClientImpl implements VirtualMachinesClient { - /** The proxy service used to perform REST calls. */ - private final VirtualMachinesService service; - - /** The service client containing this operation class. */ - private final ScvmmClientImpl client; - - /** - * Initializes an instance of VirtualMachinesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - VirtualMachinesClientImpl(ScvmmClientImpl client) { - this.service = - RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ScvmmClientVirtualMachines to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ScvmmClientVirtualMa") - private interface VirtualMachinesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualMachineInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualMachineName") String virtualMachineName, - @QueryParam("api-version") String apiVersion, - @QueryParam("retain") Boolean retain, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, - @BodyParam("application/json") VirtualMachineUpdate body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}/stop") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, - @BodyParam("application/json") StopVirtualMachineOptions body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}/createCheckpoint") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createCheckpoint( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, - @BodyParam("application/json") VirtualMachineCreateCheckpoint body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}/deleteCheckpoint") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteCheckpoint( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, - @BodyParam("application/json") VirtualMachineDeleteCheckpoint body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines/{virtualMachineName}/restoreCheckpoint") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restoreCheckpoint( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("virtualMachineName") String virtualMachineName, - @BodyParam("application/json") VirtualMachineRestoreCheckpoint body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualMachines") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualMachines") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualMachineName) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualMachineName, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String virtualMachineName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner getByResourceGroup(String resourceGroupName, String virtualMachineName) { - return getByResourceGroupAsync(resourceGroupName, virtualMachineName).block(); - } - - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualMachineName, context).block(); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - body, - accept, - context); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineInner.class, - VirtualMachineInner.class, - this.client.getContext()); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInner> beginCreateOrUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner createOrUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body) { - return createOrUpdateAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Creates Or Updates virtual machines deployed on scvmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner createOrUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force) { - 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - retain, - force, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, 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 (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualMachineName, - this.client.getApiVersion(), - retain, - force, - accept, - context); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualMachineName, retain, force); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualMachineName, retain, force, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, retain, force).getSyncPoller(); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, retain, force, context).getSyncPoller(); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, retain, force) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualMachineName) { - final Boolean retain = null; - final Boolean force = null; - return beginDeleteAsync(resourceGroupName, virtualMachineName, retain, force) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, virtualMachineName, retain, force, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force) { - deleteAsync(resourceGroupName, virtualMachineName, retain, force).block(); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualMachineName) { - final Boolean retain = null; - final Boolean force = null; - deleteAsync(resourceGroupName, virtualMachineName, retain, force).block(); - } - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, Context context) { - deleteAsync(resourceGroupName, virtualMachineName, retain, force, context).block(); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualMachineInner.class, - VirtualMachineInner.class, - this.client.getContext()); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualMachineInner> beginUpdateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualMachineInner.class, VirtualMachineInner.class, context); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - return beginUpdateAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualMachineInner> beginUpdate( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - return beginUpdateAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - return beginUpdateAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner update(String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body) { - return updateAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Updates the VirtualMachines resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body VirtualMachines patch payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner update( - String resourceGroupName, String virtualMachineName, VirtualMachineUpdate body, Context context) { - return updateAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .stop( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> stopWithResponseAsync( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .stop( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStopAsync( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - stopWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body) { - return beginStopAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context) { - return beginStopAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body) { - return beginStopAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync(String resourceGroupName, String virtualMachineName) { - final StopVirtualMachineOptions body = null; - return beginStopAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono stopAsync( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context) { - return beginStopAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body) { - stopAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String virtualMachineName) { - final StopVirtualMachineOptions body = null; - stopAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context) { - stopAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .start( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync( - String resourceGroupName, String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .start( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - accept, - context); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String virtualMachineName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, virtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync( - String resourceGroupName, String virtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, virtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String virtualMachineName) { - return beginStartAsync(resourceGroupName, virtualMachineName).getSyncPoller(); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart( - String resourceGroupName, String virtualMachineName, Context context) { - return beginStartAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String virtualMachineName) { - return beginStartAsync(resourceGroupName, virtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String virtualMachineName, Context context) { - return beginStartAsync(resourceGroupName, virtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String virtualMachineName) { - startAsync(resourceGroupName, virtualMachineName).block(); - } - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String virtualMachineName, Context context) { - startAsync(resourceGroupName, virtualMachineName, context).block(); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String virtualMachineName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .restart( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync( - String resourceGroupName, String virtualMachineName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .restart( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - accept, - context); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String virtualMachineName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, virtualMachineName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync( - String resourceGroupName, String virtualMachineName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restartWithResponseAsync(resourceGroupName, virtualMachineName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart(String resourceGroupName, String virtualMachineName) { - return beginRestartAsync(resourceGroupName, virtualMachineName).getSyncPoller(); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart( - String resourceGroupName, String virtualMachineName, Context context) { - return beginRestartAsync(resourceGroupName, virtualMachineName, context).getSyncPoller(); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String virtualMachineName) { - return beginRestartAsync(resourceGroupName, virtualMachineName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String virtualMachineName, Context context) { - return beginRestartAsync(resourceGroupName, virtualMachineName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String virtualMachineName) { - restartAsync(resourceGroupName, virtualMachineName).block(); - } - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String virtualMachineName, Context context) { - restartAsync(resourceGroupName, virtualMachineName, context).block(); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createCheckpointWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createCheckpoint( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createCheckpointWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createCheckpoint( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCreateCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body) { - Mono>> mono = - createCheckpointWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCreateCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createCheckpointWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCreateCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body) { - return beginCreateCheckpointAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCreateCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context) { - return beginCreateCheckpointAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body) { - return beginCreateCheckpointAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createCheckpointAsync(String resourceGroupName, String virtualMachineName) { - final VirtualMachineCreateCheckpoint body = null; - return beginCreateCheckpointAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context) { - return beginCreateCheckpointAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void createCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body) { - createCheckpointAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void createCheckpoint(String resourceGroupName, String virtualMachineName) { - final VirtualMachineCreateCheckpoint body = null; - createCheckpointAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void createCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context) { - createCheckpointAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteCheckpointWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteCheckpoint( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteCheckpointWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteCheckpoint( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body) { - Mono>> mono = - deleteCheckpointWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteCheckpointWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body) { - return beginDeleteCheckpointAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context) { - return beginDeleteCheckpointAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body) { - return beginDeleteCheckpointAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteCheckpointAsync(String resourceGroupName, String virtualMachineName) { - final VirtualMachineDeleteCheckpoint body = null; - return beginDeleteCheckpointAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context) { - return beginDeleteCheckpointAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body) { - deleteCheckpointAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCheckpoint(String resourceGroupName, String virtualMachineName) { - final VirtualMachineDeleteCheckpoint body = null; - deleteCheckpointAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context) { - deleteCheckpointAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreCheckpointWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .restoreCheckpoint( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restoreCheckpointWithResponseAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (virtualMachineName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualMachineName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .restoreCheckpoint( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualMachineName, - body, - accept, - context); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestoreCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body) { - Mono>> mono = - restoreCheckpointWithResponseAsync(resourceGroupName, virtualMachineName, body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestoreCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - restoreCheckpointWithResponseAsync(resourceGroupName, virtualMachineName, body, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body) { - return beginRestoreCheckpointAsync(resourceGroupName, virtualMachineName, body).getSyncPoller(); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context) { - return beginRestoreCheckpointAsync(resourceGroupName, virtualMachineName, body, context).getSyncPoller(); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body) { - return beginRestoreCheckpointAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreCheckpointAsync(String resourceGroupName, String virtualMachineName) { - final VirtualMachineRestoreCheckpoint body = null; - return beginRestoreCheckpointAsync(resourceGroupName, virtualMachineName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restoreCheckpointAsync( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context) { - return beginRestoreCheckpointAsync(resourceGroupName, virtualMachineName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body) { - restoreCheckpointAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreCheckpoint(String resourceGroupName, String virtualMachineName) { - final VirtualMachineRestoreCheckpoint body = null; - restoreCheckpointAsync(resourceGroupName, virtualMachineName, body).block(); - } - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context) { - restoreCheckpointAsync(resourceGroupName, virtualMachineName, body, context).block(); - } - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List of VirtualMachines in a 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 list of VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List of VirtualMachines in a 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 list of VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List of VirtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List of VirtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List of VirtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List of VirtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(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 nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - 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 - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - 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 - .listBySubscriptionNext(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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachinesImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachinesImpl.java deleted file mode 100644 index 5df67adcbef1b..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualMachinesImpl.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.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.scvmm.fluent.VirtualMachinesClient; -import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInner; -import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; -import com.azure.resourcemanager.scvmm.models.VirtualMachine; -import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; -import com.azure.resourcemanager.scvmm.models.VirtualMachines; - -public final class VirtualMachinesImpl implements VirtualMachines { - private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinesImpl.class); - - private final VirtualMachinesClient innerClient; - - private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; - - public VirtualMachinesImpl( - VirtualMachinesClient innerClient, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName) { - VirtualMachineInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualMachineName); - if (inner != null) { - return new VirtualMachineImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VirtualMachineImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, retain, force); - } - - public void delete(String resourceGroupName, String virtualMachineName) { - this.serviceClient().delete(resourceGroupName, virtualMachineName); - } - - public void delete( - String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, Context context) { - this.serviceClient().delete(resourceGroupName, virtualMachineName, retain, force, context); - } - - public void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body) { - this.serviceClient().stop(resourceGroupName, virtualMachineName, body); - } - - public void stop(String resourceGroupName, String virtualMachineName) { - this.serviceClient().stop(resourceGroupName, virtualMachineName); - } - - public void stop( - String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context) { - this.serviceClient().stop(resourceGroupName, virtualMachineName, body, context); - } - - public void start(String resourceGroupName, String virtualMachineName) { - this.serviceClient().start(resourceGroupName, virtualMachineName); - } - - public void start(String resourceGroupName, String virtualMachineName, Context context) { - this.serviceClient().start(resourceGroupName, virtualMachineName, context); - } - - public void restart(String resourceGroupName, String virtualMachineName) { - this.serviceClient().restart(resourceGroupName, virtualMachineName); - } - - public void restart(String resourceGroupName, String virtualMachineName, Context context) { - this.serviceClient().restart(resourceGroupName, virtualMachineName, context); - } - - public void createCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body) { - this.serviceClient().createCheckpoint(resourceGroupName, virtualMachineName, body); - } - - public void createCheckpoint(String resourceGroupName, String virtualMachineName) { - this.serviceClient().createCheckpoint(resourceGroupName, virtualMachineName); - } - - public void createCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context) { - this.serviceClient().createCheckpoint(resourceGroupName, virtualMachineName, body, context); - } - - public void deleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body) { - this.serviceClient().deleteCheckpoint(resourceGroupName, virtualMachineName, body); - } - - public void deleteCheckpoint(String resourceGroupName, String virtualMachineName) { - this.serviceClient().deleteCheckpoint(resourceGroupName, virtualMachineName); - } - - public void deleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context) { - this.serviceClient().deleteCheckpoint(resourceGroupName, virtualMachineName, body, context); - } - - public void restoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body) { - this.serviceClient().restoreCheckpoint(resourceGroupName, virtualMachineName, body); - } - - public void restoreCheckpoint(String resourceGroupName, String virtualMachineName) { - this.serviceClient().restoreCheckpoint(resourceGroupName, virtualMachineName); - } - - public void restoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context) { - this.serviceClient().restoreCheckpoint(resourceGroupName, virtualMachineName, body, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.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())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.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())); - } - - public VirtualMachine getById(String id) { - String resourceGroupName = Utils.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"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.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"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, virtualMachineName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.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"); - if (virtualMachineName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualMachines'.", id))); - } - Boolean localRetain = null; - Boolean localForce = null; - this.delete(resourceGroupName, virtualMachineName, localRetain, localForce, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Boolean retain, Boolean force, Context context) { - String resourceGroupName = Utils.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"); - 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, retain, force, context); - } - - private VirtualMachinesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.scvmm.ScvmmManager manager() { - return this.serviceManager; - } - - public VirtualMachineImpl define(String name) { - return new VirtualMachineImpl(name, this.manager()); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworkImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworkImpl.java index 5b674d7599672..81fbd51a5868c 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworkImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworkImpl.java @@ -9,8 +9,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.VirtualNetworkInner; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; import com.azure.resourcemanager.scvmm.models.VirtualNetwork; +import com.azure.resourcemanager.scvmm.models.VirtualNetworkProperties; +import com.azure.resourcemanager.scvmm.models.VirtualNetworkTagsUpdate; import java.util.Collections; import java.util.Map; @@ -44,32 +45,16 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); + public VirtualNetworkProperties properties() { + return this.innerModel().properties(); } public ExtendedLocation extendedLocation() { return this.innerModel().extendedLocation(); } - public String inventoryItemId() { - return this.innerModel().inventoryItemId(); - } - - public String uuid() { - return this.innerModel().uuid(); - } - - public String vmmServerId() { - return this.innerModel().vmmServerId(); - } - - public String networkName() { - return this.innerModel().networkName(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -80,6 +65,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public VirtualNetworkInner innerModel() { return this.innerObject; } @@ -92,7 +81,7 @@ private com.azure.resourcemanager.scvmm.ScvmmManager manager() { private String virtualNetworkName; - private ResourcePatch updateBody; + private VirtualNetworkTagsUpdate updateProperties; public VirtualNetworkImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -100,20 +89,14 @@ public VirtualNetworkImpl withExistingResourceGroup(String resourceGroupName) { } public VirtualNetwork create() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworks() - .createOrUpdate(resourceGroupName, virtualNetworkName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getVirtualNetworks().createOrUpdate(resourceGroupName, + virtualNetworkName, this.innerModel(), Context.NONE); return this; } public VirtualNetwork create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworks() - .createOrUpdate(resourceGroupName, virtualNetworkName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getVirtualNetworks().createOrUpdate(resourceGroupName, + virtualNetworkName, this.innerModel(), context); return this; } @@ -124,52 +107,38 @@ public VirtualNetwork create(Context context) { } public VirtualNetworkImpl update() { - this.updateBody = new ResourcePatch(); + this.updateProperties = new VirtualNetworkTagsUpdate(); return this; } public VirtualNetwork apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworks() - .update(resourceGroupName, virtualNetworkName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient().getVirtualNetworks().update(resourceGroupName, + virtualNetworkName, updateProperties, Context.NONE); return this; } public VirtualNetwork apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworks() - .update(resourceGroupName, virtualNetworkName, updateBody, context); + this.innerObject = serviceManager.serviceClient().getVirtualNetworks().update(resourceGroupName, + virtualNetworkName, updateProperties, context); return this; } VirtualNetworkImpl(VirtualNetworkInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.virtualNetworkName = Utils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); } public VirtualNetwork refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworks() - .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getVirtualNetworks() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, Context.NONE).getValue(); return this; } public VirtualNetwork refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVirtualNetworks() - .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getVirtualNetworks() + .getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, context).getValue(); return this; } @@ -193,23 +162,13 @@ public VirtualNetworkImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } else { - this.updateBody.withTags(tags); + this.updateProperties.withTags(tags); return this; } } - public VirtualNetworkImpl withInventoryItemId(String inventoryItemId) { - this.innerModel().withInventoryItemId(inventoryItemId); - return this; - } - - public VirtualNetworkImpl withUuid(String uuid) { - this.innerModel().withUuid(uuid); - return this; - } - - public VirtualNetworkImpl withVmmServerId(String vmmServerId) { - this.innerModel().withVmmServerId(vmmServerId); + public VirtualNetworkImpl withProperties(VirtualNetworkProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworksClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworksClientImpl.java index 54a30f20e63eb..9c21fb962c0de 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworksClientImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworksClientImpl.java @@ -34,597 +34,502 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.scvmm.fluent.VirtualNetworksClient; import com.azure.resourcemanager.scvmm.fluent.models.VirtualNetworkInner; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; import com.azure.resourcemanager.scvmm.models.VirtualNetworkListResult; +import com.azure.resourcemanager.scvmm.models.VirtualNetworkTagsUpdate; 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 VirtualNetworksClient. */ +/** + * An instance of this class provides access to all the operations defined in VirtualNetworksClient. + */ public final class VirtualNetworksClientImpl implements VirtualNetworksClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final VirtualNetworksService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ScvmmClientImpl client; /** * Initializes an instance of VirtualNetworksClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ VirtualNetworksClientImpl(ScvmmClientImpl client) { - this.service = - RestProxy.create(VirtualNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(VirtualNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ScvmmClientVirtualNetworks to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for ScvmmClientVirtualNetworks to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "ScvmmClientVirtualNe") - private interface VirtualNetworksService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualNetworks/{virtualNetworkName}") - @ExpectedResponses({200}) + public interface VirtualNetworksService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualNetworks") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualNetworks/{virtualNetworkName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualNetworkInner body, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualNetworks/{virtualNetworkName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("virtualNetworkName") String virtualNetworkName, - @QueryParam("api-version") String apiVersion, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, + @PathParam("virtualNetworkName") String virtualNetworkName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualNetworks/{virtualNetworkName}") - @ExpectedResponses({200, 201, 202}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @PathParam("virtualNetworkName") String virtualNetworkName, - @BodyParam("application/json") ResourcePatch body, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") VirtualNetworkInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm" - + "/virtualNetworks") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, + @PathParam("virtualNetworkName") String virtualNetworkName, + @BodyParam("application/json") VirtualNetworkTagsUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualNetworks") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("force") Boolean force, + @PathParam("virtualNetworkName") String virtualNetworkName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VirtualNetworks in a 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 the VirtualNetworks resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the response of a VirtualNetwork list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualNetworkName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); } /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. + * List of VirtualNetworks in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualNetworks resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the response of a VirtualNetwork list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String virtualNetworkName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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 (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualNetworkName, - this.client.getApiVersion(), - accept, - context); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VirtualNetworks in a 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 the VirtualNetworks resource definition on successful completion of {@link Mono}. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. + * List of VirtualNetworks in a subscription. + * + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { - return getByResourceGroupAsync(resourceGroupName, virtualNetworkName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. + * List of VirtualNetworks in a 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 the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List of VirtualNetworks in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualNetworks resource definition along with {@link Response}. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * List of VirtualNetworks in a 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 the VirtualNetworks resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the response of a VirtualNetwork list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualNetworkName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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())); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * List of VirtualNetworks in a 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 the VirtualNetworks resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the response of a VirtualNetwork list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.")); + 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 (virtualNetworkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualNetworkName, - this.client.getApiVersion(), - body, - accept, - context); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * List of VirtualNetworks in a 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 the {@link PollerFlux} for polling of the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkInner.class, - VirtualNetworkInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * List of VirtualNetworks in a 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 the {@link PollerFlux} for polling of the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualNetworkInner.class, VirtualNetworkInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * List of VirtualNetworks in a 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 the {@link SyncPoller} for polling of the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. + * List of VirtualNetworks in a 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 the {@link SyncPoller} for polling of the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualNetworks resource definition on successful completion of {@link Mono}. + * @return the VirtualNetworks resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String virtualNetworkName) { + 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 (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualNetworks resource definition on successful completion of {@link Mono}. + * @return the VirtualNetworks resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String virtualNetworkName, 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 (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, accept, context); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualNetworks resource definition. + * @return the VirtualNetworks resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, body).block(); + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Onboards the ScVmm virtual network as an Azure virtual network resource. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body Request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VirtualNetworks resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualNetworkName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, context).block(); + } + + /** + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner createOrUpdate( - String resourceGroupName, String virtualNetworkName, VirtualNetworkInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, body, context).block(); + public VirtualNetworkInner getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, Context.NONE).getValue(); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VirtualNetworks resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, Boolean force) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String virtualNetworkName, VirtualNetworkInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -634,50 +539,41 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualNetworkName, - this.client.getApiVersion(), - force, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the VirtualNetworks resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String virtualNetworkName, Boolean force, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String virtualNetworkName, VirtualNetworkInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -687,352 +583,278 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - virtualNetworkName, - this.client.getApiVersion(), - force, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, resource, accept, context); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, Boolean force) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, force); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, VirtualNetworkInner> + beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VirtualNetworkInner.class, VirtualNetworkInner.class, this.client.getContext()); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String virtualNetworkName, Boolean force, Context context) { + private PollerFlux, VirtualNetworkInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, virtualNetworkName, force, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VirtualNetworkInner.class, VirtualNetworkInner.class, context); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, Boolean force) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, force).getSyncPoller(); + public SyncPoller, VirtualNetworkInner> + beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, resource).getSyncPoller(); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String virtualNetworkName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, force, context).getSyncPoller(); - } - - /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualNetworkName, Boolean force) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, force) - .last() - .flatMap(this.client::getLroFinalResultOrError); + public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, resource, context).getSyncPoller(); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 VirtualNetworks resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String virtualNetworkName) { - final Boolean force = null; - return beginDeleteAsync(resourceGroupName, virtualNetworkName, force) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, + VirtualNetworkInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the VirtualNetworks resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String virtualNetworkName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, force, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, + VirtualNetworkInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkName, Boolean force) { - deleteAsync(resourceGroupName, virtualNetworkName, force).block(); - } - - /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkName) { - final Boolean force = null; - deleteAsync(resourceGroupName, virtualNetworkName, force).block(); + public VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, + VirtualNetworkInner resource) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkName, resource).block(); } /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Onboards the ScVmm virtual network as an Azure virtual network resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String virtualNetworkName, Boolean force, Context context) { - deleteAsync(resourceGroupName, virtualNetworkName, force, context).block(); + public VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, + VirtualNetworkInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualNetworkName, resource, context).block(); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualNetworks resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the VirtualNetworks resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, ResourcePatch body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String virtualNetworkName, VirtualNetworkTagsUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (virtualNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualNetworkName, - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualNetworks resource definition along with {@link Response} on successful completion of {@link - * Mono}. + * @return the VirtualNetworks resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String virtualNetworkName, VirtualNetworkTagsUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (virtualNetworkName == null) { return Mono .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - virtualNetworkName, - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, virtualNetworkName, properties, accept, context); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualNetworkInner> beginUpdateAsync( - String resourceGroupName, String virtualNetworkName, ResourcePatch body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, virtualNetworkName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VirtualNetworkInner.class, - VirtualNetworkInner.class, - this.client.getContext()); + private PollerFlux, VirtualNetworkInner> beginUpdateAsync(String resourceGroupName, + String virtualNetworkName, VirtualNetworkTagsUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, virtualNetworkName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VirtualNetworkInner.class, VirtualNetworkInner.class, this.client.getContext()); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1040,40 +862,38 @@ private PollerFlux, VirtualNetworkInner> beginUp * @return the {@link PollerFlux} for polling of the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VirtualNetworkInner> beginUpdateAsync( - String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context) { + private PollerFlux, VirtualNetworkInner> beginUpdateAsync(String resourceGroupName, + String virtualNetworkName, VirtualNetworkTagsUpdate properties, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, virtualNetworkName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VirtualNetworkInner.class, VirtualNetworkInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, virtualNetworkName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VirtualNetworkInner.class, VirtualNetworkInner.class, context); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualNetworkInner> beginUpdate( - String resourceGroupName, String virtualNetworkName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, virtualNetworkName, body).getSyncPoller(); + public SyncPoller, VirtualNetworkInner> beginUpdate(String resourceGroupName, + String virtualNetworkName, VirtualNetworkTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, virtualNetworkName, properties).getSyncPoller(); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1081,36 +901,35 @@ public SyncPoller, VirtualNetworkInner> beginUpd * @return the {@link SyncPoller} for polling of the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VirtualNetworkInner> beginUpdate( - String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, virtualNetworkName, body, context).getSyncPoller(); + public SyncPoller, VirtualNetworkInner> beginUpdate(String resourceGroupName, + String virtualNetworkName, VirtualNetworkTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, virtualNetworkName, properties, context).getSyncPoller(); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualNetworks resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualNetworkName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, virtualNetworkName, body) - .last() + private Mono updateAsync(String resourceGroupName, String virtualNetworkName, + VirtualNetworkTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, virtualNetworkName, properties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1118,35 +937,35 @@ private Mono updateAsync( * @return the VirtualNetworks resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, virtualNetworkName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String virtualNetworkName, + VirtualNetworkTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, virtualNetworkName, properties, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName, ResourcePatch body) { - return updateAsync(resourceGroupName, virtualNetworkName, body).block(); + public VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName, + VirtualNetworkTagsUpdate properties) { + return updateAsync(resourceGroupName, virtualNetworkName, properties).block(); } /** * Updates the VirtualNetworks resource. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param body VirtualNetworks patch payload. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1154,458 +973,379 @@ public VirtualNetworkInner update(String resourceGroupName, String virtualNetwor * @return the VirtualNetworks resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualNetworkInner update( - String resourceGroupName, String virtualNetworkName, ResourcePatch body, Context context) { - return updateAsync(resourceGroupName, virtualNetworkName, body, context).block(); + public VirtualNetworkInner update(String resourceGroupName, String virtualNetworkName, + VirtualNetworkTagsUpdate properties, Context context) { + return updateAsync(resourceGroupName, virtualNetworkName, properties, context).block(); } /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String virtualNetworkName, Boolean force) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, force, virtualNetworkName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String virtualNetworkName, Boolean force, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, force, virtualNetworkName, accept, context); } /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkName, + Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualNetworkName, + Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualNetworkName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, force).getSyncPoller(); } /** - * List of VirtualNetworks in a subscription. - * + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, + Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualNetworkName, force, context).getSyncPoller(); } /** - * List of VirtualNetworks in a subscription. - * - * @param context The context to associate with this operation. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + private Mono deleteAsync(String resourceGroupName, String virtualNetworkName, Boolean force) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VirtualNetworks in a subscription. - * + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualNetworkName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, virtualNetworkName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VirtualNetworks in a subscription. - * + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualNetworkName, Boolean force, + Context context) { + return beginDeleteAsync(resourceGroupName, virtualNetworkName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VirtualNetworks in a subscription. - * + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualNetworkName) { + final Boolean force = null; + deleteAsync(resourceGroupName, virtualNetworkName, force).block(); } /** - * List of VirtualNetworks in a subscription. - * + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String virtualNetworkName, Boolean force, Context context) { + deleteAsync(resourceGroupName, virtualNetworkName, force, context).block(); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a VirtualNetwork list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listBySubscriptionNext(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 nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a VirtualNetwork list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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 - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a VirtualNetwork list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a VirtualNetwork list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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 - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworksImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworksImpl.java index 08e84a969e40d..05f7f4023d3fc 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworksImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VirtualNetworksImpl.java @@ -21,40 +21,53 @@ public final class VirtualNetworksImpl implements VirtualNetworks { private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; - public VirtualNetworksImpl( - VirtualNetworksClient innerClient, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + public VirtualNetworksImpl(VirtualNetworksClient innerClient, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName) { - VirtualNetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkName); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String virtualNetworkName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, context); if (inner != null) { - return new VirtualNetworkImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VirtualNetworkImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, context); + public VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName) { + VirtualNetworkInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, virtualNetworkName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VirtualNetworkImpl(inner.getValue(), this.manager())); + return new VirtualNetworkImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String virtualNetworkName, Boolean force) { - this.serviceClient().delete(resourceGroupName, virtualNetworkName, force); - } - public void delete(String resourceGroupName, String virtualNetworkName) { this.serviceClient().delete(resourceGroupName, virtualNetworkName); } @@ -63,103 +76,59 @@ public void delete(String resourceGroupName, String virtualNetworkName, Boolean this.serviceClient().delete(resourceGroupName, virtualNetworkName, force, context); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); - } - public VirtualNetwork 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + String virtualNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "virtualNetworks"); if (virtualNetworkName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, Context.NONE).getValue(); } 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + String virtualNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "virtualNetworks"); if (virtualNetworkName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, context); } public void deleteById(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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + String virtualNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "virtualNetworks"); if (virtualNetworkName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); } Boolean localForce = null; this.delete(resourceGroupName, virtualNetworkName, localForce, Context.NONE); } public void deleteByIdWithResponse(String id, Boolean force, 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String virtualNetworkName = Utils.getValueFromIdByName(id, "virtualNetworks"); + String virtualNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "virtualNetworks"); if (virtualNetworkName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'virtualNetworks'.", id))); } this.delete(resourceGroupName, virtualNetworkName, force, context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadataImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadataImpl.java new file mode 100644 index 0000000000000..1c4055d5248ba --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadataImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.scvmm.fluent.models.VmInstanceHybridIdentityMetadataInner; +import com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadata; +import com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadataProperties; + +public final class VmInstanceHybridIdentityMetadataImpl implements VmInstanceHybridIdentityMetadata { + private VmInstanceHybridIdentityMetadataInner innerObject; + + private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; + + VmInstanceHybridIdentityMetadataImpl(VmInstanceHybridIdentityMetadataInner innerObject, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public VmInstanceHybridIdentityMetadataProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VmInstanceHybridIdentityMetadataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.scvmm.ScvmmManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadatasClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadatasClientImpl.java new file mode 100644 index 0000000000000..306f6618b7786 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadatasClientImpl.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.scvmm.fluent.VmInstanceHybridIdentityMetadatasClient; +import com.azure.resourcemanager.scvmm.fluent.models.VmInstanceHybridIdentityMetadataInner; +import com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadataListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in VmInstanceHybridIdentityMetadatasClient. + */ +public final class VmInstanceHybridIdentityMetadatasClientImpl implements VmInstanceHybridIdentityMetadatasClient { + /** + * The proxy service used to perform REST calls. + */ + private final VmInstanceHybridIdentityMetadatasService service; + + /** + * The service client containing this operation class. + */ + private final ScvmmClientImpl client; + + /** + * Initializes an instance of VmInstanceHybridIdentityMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VmInstanceHybridIdentityMetadatasClientImpl(ScvmmClientImpl client) { + this.service = RestProxy.create(VmInstanceHybridIdentityMetadatasService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ScvmmClientVmInstanceHybridIdentityMetadatas to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ScvmmClientVmInstanc") + public interface VmInstanceHybridIdentityMetadatasService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVirtualMachineInstance( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVirtualMachineInstanceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a VmInstanceHybridIdentityMetadata list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByVirtualMachineInstanceSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByVirtualMachineInstance(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmInstanceHybridIdentityMetadata list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByVirtualMachineInstanceSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVirtualMachineInstance(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a VmInstanceHybridIdentityMetadata list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualMachineInstanceAsync(String resourceUri) { + return new PagedFlux<>(() -> listByVirtualMachineInstanceSinglePageAsync(resourceUri), + nextLink -> listByVirtualMachineInstanceNextSinglePageAsync(nextLink)); + } + + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmInstanceHybridIdentityMetadata list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVirtualMachineInstanceAsync(String resourceUri, + Context context) { + return new PagedFlux<>(() -> listByVirtualMachineInstanceSinglePageAsync(resourceUri, context), + nextLink -> listByVirtualMachineInstanceNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a VmInstanceHybridIdentityMetadata list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualMachineInstance(String resourceUri) { + return new PagedIterable<>(listByVirtualMachineInstanceAsync(resourceUri)); + } + + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmInstanceHybridIdentityMetadata list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVirtualMachineInstance(String resourceUri, + Context context) { + return new PagedIterable<>(listByVirtualMachineInstanceAsync(resourceUri, context)); + } + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri 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(), resourceUri, accept, context); + } + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 defines the HybridIdentityMetadata on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri) { + return getWithResponseAsync(resourceUri).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, Context context) { + return getWithResponseAsync(resourceUri, context).block(); + } + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 defines the HybridIdentityMetadata. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VmInstanceHybridIdentityMetadataInner get(String resourceUri) { + return getWithResponse(resourceUri, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmInstanceHybridIdentityMetadata list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByVirtualMachineInstanceNextSinglePageAsync(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.listByVirtualMachineInstanceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmInstanceHybridIdentityMetadata list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByVirtualMachineInstanceNextSinglePageAsync(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.listByVirtualMachineInstanceNext(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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadatasImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadatasImpl.java new file mode 100644 index 0000000000000..062ae78159345 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmInstanceHybridIdentityMetadatasImpl.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.scvmm.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.scvmm.fluent.VmInstanceHybridIdentityMetadatasClient; +import com.azure.resourcemanager.scvmm.fluent.models.VmInstanceHybridIdentityMetadataInner; +import com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadata; +import com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadatas; + +public final class VmInstanceHybridIdentityMetadatasImpl implements VmInstanceHybridIdentityMetadatas { + private static final ClientLogger LOGGER = new ClientLogger(VmInstanceHybridIdentityMetadatasImpl.class); + + private final VmInstanceHybridIdentityMetadatasClient innerClient; + + private final com.azure.resourcemanager.scvmm.ScvmmManager serviceManager; + + public VmInstanceHybridIdentityMetadatasImpl(VmInstanceHybridIdentityMetadatasClient innerClient, + com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByVirtualMachineInstance(String resourceUri) { + PagedIterable inner + = this.serviceClient().listByVirtualMachineInstance(resourceUri); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new VmInstanceHybridIdentityMetadataImpl(inner1, this.manager())); + } + + public PagedIterable listByVirtualMachineInstance(String resourceUri, + Context context) { + PagedIterable inner + = this.serviceClient().listByVirtualMachineInstance(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new VmInstanceHybridIdentityMetadataImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceUri, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceUri, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VmInstanceHybridIdentityMetadataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VmInstanceHybridIdentityMetadata get(String resourceUri) { + VmInstanceHybridIdentityMetadataInner inner = this.serviceClient().get(resourceUri); + if (inner != null) { + return new VmInstanceHybridIdentityMetadataImpl(inner, this.manager()); + } else { + return null; + } + } + + private VmInstanceHybridIdentityMetadatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.scvmm.ScvmmManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServerImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServerImpl.java index b2928a3b1a951..3aa289ce63a65 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServerImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServerImpl.java @@ -9,9 +9,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.VmmServerInner; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; import com.azure.resourcemanager.scvmm.models.VmmServer; -import com.azure.resourcemanager.scvmm.models.VmmServerPropertiesCredentials; +import com.azure.resourcemanager.scvmm.models.VmmServerProperties; +import com.azure.resourcemanager.scvmm.models.VmmServerTagsUpdate; import java.util.Collections; import java.util.Map; @@ -45,44 +45,16 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); + public VmmServerProperties properties() { + return this.innerModel().properties(); } public ExtendedLocation extendedLocation() { return this.innerModel().extendedLocation(); } - public VmmServerPropertiesCredentials credentials() { - return this.innerModel().credentials(); - } - - public String fqdn() { - return this.innerModel().fqdn(); - } - - public Integer port() { - return this.innerModel().port(); - } - - public String connectionStatus() { - return this.innerModel().connectionStatus(); - } - - public String errorMessage() { - return this.innerModel().errorMessage(); - } - - public String uuid() { - return this.innerModel().uuid(); - } - - public String version() { - return this.innerModel().version(); - } - - public String provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -93,6 +65,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public VmmServerInner innerModel() { return this.innerObject; } @@ -105,7 +81,7 @@ private com.azure.resourcemanager.scvmm.ScvmmManager manager() { private String vmmServerName; - private ResourcePatch updateBody; + private VmmServerTagsUpdate updateProperties; public VmmServerImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -113,20 +89,14 @@ public VmmServerImpl withExistingResourceGroup(String resourceGroupName) { } public VmmServer create() { - this.innerObject = - serviceManager - .serviceClient() - .getVmmServers() - .createOrUpdate(resourceGroupName, vmmServerName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getVmmServers().createOrUpdate(resourceGroupName, + vmmServerName, this.innerModel(), Context.NONE); return this; } public VmmServer create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVmmServers() - .createOrUpdate(resourceGroupName, vmmServerName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getVmmServers().createOrUpdate(resourceGroupName, + vmmServerName, this.innerModel(), context); return this; } @@ -137,52 +107,38 @@ public VmmServer create(Context context) { } public VmmServerImpl update() { - this.updateBody = new ResourcePatch(); + this.updateProperties = new VmmServerTagsUpdate(); return this; } public VmmServer apply() { - this.innerObject = - serviceManager - .serviceClient() - .getVmmServers() - .update(resourceGroupName, vmmServerName, updateBody, Context.NONE); + this.innerObject = serviceManager.serviceClient().getVmmServers().update(resourceGroupName, vmmServerName, + updateProperties, Context.NONE); return this; } public VmmServer apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVmmServers() - .update(resourceGroupName, vmmServerName, updateBody, context); + this.innerObject = serviceManager.serviceClient().getVmmServers().update(resourceGroupName, vmmServerName, + updateProperties, context); return this; } VmmServerImpl(VmmServerInner innerObject, com.azure.resourcemanager.scvmm.ScvmmManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.vmmServerName = Utils.getValueFromIdByName(innerObject.id(), "vmmServers"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vmmServerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vmmServers"); } public VmmServer refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getVmmServers() - .getByResourceGroupWithResponse(resourceGroupName, vmmServerName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getVmmServers() + .getByResourceGroupWithResponse(resourceGroupName, vmmServerName, Context.NONE).getValue(); return this; } public VmmServer refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getVmmServers() - .getByResourceGroupWithResponse(resourceGroupName, vmmServerName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getVmmServers() + .getByResourceGroupWithResponse(resourceGroupName, vmmServerName, context).getValue(); return this; } @@ -201,28 +157,18 @@ public VmmServerImpl withExtendedLocation(ExtendedLocation extendedLocation) { return this; } - public VmmServerImpl withFqdn(String fqdn) { - this.innerModel().withFqdn(fqdn); - return this; - } - public VmmServerImpl withTags(Map tags) { if (isInCreateMode()) { this.innerModel().withTags(tags); return this; } else { - this.updateBody.withTags(tags); + this.updateProperties.withTags(tags); return this; } } - public VmmServerImpl withCredentials(VmmServerPropertiesCredentials credentials) { - this.innerModel().withCredentials(credentials); - return this; - } - - public VmmServerImpl withPort(Integer port) { - this.innerModel().withPort(port); + public VmmServerImpl withProperties(VmmServerProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServersClientImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServersClientImpl.java index 71c1e632b9f05..20b9b26aa36e4 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServersClientImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServersClientImpl.java @@ -34,585 +34,493 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.scvmm.fluent.VmmServersClient; import com.azure.resourcemanager.scvmm.fluent.models.VmmServerInner; -import com.azure.resourcemanager.scvmm.models.ResourcePatch; import com.azure.resourcemanager.scvmm.models.VmmServerListResult; +import com.azure.resourcemanager.scvmm.models.VmmServerTagsUpdate; 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 VmmServersClient. */ +/** + * An instance of this class provides access to all the operations defined in VmmServersClient. + */ public final class VmmServersClientImpl implements VmmServersClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final VmmServersService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ScvmmClientImpl client; /** * Initializes an instance of VmmServersClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ VmmServersClientImpl(ScvmmClientImpl client) { - this.service = - RestProxy.create(VmmServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(VmmServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ScvmmClientVmmServers to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for ScvmmClientVmmServers to be used by the proxy service to perform + * REST calls. */ @Host("{$host}") @ServiceInterface(name = "ScvmmClientVmmServer") - private interface VmmServersService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" - + "/{vmmServerName}") - @ExpectedResponses({200}) + public interface VmmServersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/vmmServers") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmmServerName") String vmmServerName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" - + "/{vmmServerName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmmServerName") String vmmServerName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VmmServerInner body, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" - + "/{vmmServerName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmmServerName") String vmmServerName, - @QueryParam("api-version") String apiVersion, - @QueryParam("force") Boolean force, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" - + "/{vmmServerName}") - @ExpectedResponses({200, 201, 202}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmmServerName") String vmmServerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("vmmServerName") String vmmServerName, - @BodyParam("application/json") ResourcePatch body, - @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmmServerName") String vmmServerName, + @BodyParam("application/json") VmmServerInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmmServerName") String vmmServerName, + @BodyParam("application/json") VmmServerTagsUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/vmmServers") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("force") Boolean force, + @PathParam("vmmServerName") String vmmServerName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VmmServers in a 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 the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmmServerName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (vmmServerName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); } /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * List of VmmServers in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vmmServerName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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 (vmmServerName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - this.client.getApiVersion(), - accept, - context); + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VmmServers in a 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 the VmmServers resource definition on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String vmmServerName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vmmServerName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * List of VmmServers in a subscription. + * + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VmmServerInner getByResourceGroup(String resourceGroupName, String vmmServerName) { - return getByResourceGroupAsync(resourceGroupName, vmmServerName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List of VmmServers in a 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 the response of a VmmServer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); } /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * List of VmmServers in a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VmmServers resource definition along with {@link Response}. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vmmServerName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, vmmServerName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * List of VmmServers in a 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 the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmmServerName, VmmServerInner body) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (vmmServerName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - this.client.getApiVersion(), - body, - accept, - context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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())); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * List of VmmServers in a 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 the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vmmServerName, VmmServerInner body, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.")); + 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 (vmmServerName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - this.client.getApiVersion(), - body, - accept, - context); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * List of VmmServers in a 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 the {@link PollerFlux} for polling of the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VmmServerInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmmServerName, VmmServerInner body) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, vmmServerName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VmmServerInner.class, - VmmServerInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * List of VmmServers in a 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 the {@link PollerFlux} for polling of the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VmmServerInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vmmServerName, VmmServerInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vmmServerName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VmmServerInner.class, VmmServerInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * List of VmmServers in a 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 the {@link SyncPoller} for polling of the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VmmServerInner> beginCreateOrUpdate( - String resourceGroupName, String vmmServerName, VmmServerInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, vmmServerName, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * List of VmmServers in a 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 the {@link SyncPoller} for polling of the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VmmServerInner> beginCreateOrUpdate( - String resourceGroupName, String vmmServerName, VmmServerInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmmServerName, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VmmServers resource definition on successful completion of {@link Mono}. + * @return the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String vmmServerName, VmmServerInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, vmmServerName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String vmmServerName) { + 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 (vmmServerName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VmmServers resource definition on successful completion of {@link Mono}. + * @return the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String vmmServerName, VmmServerInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vmmServerName, body, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String vmmServerName, 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 (vmmServerName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, accept, context); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VmmServers resource definition. + * @return the VmmServers resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VmmServerInner createOrUpdate(String resourceGroupName, String vmmServerName, VmmServerInner body) { - return createOrUpdateAsync(resourceGroupName, vmmServerName, body).block(); + private Mono getByResourceGroupAsync(String resourceGroupName, String vmmServerName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmmServerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Onboards the SCVMM fabric as an Azure VmmServer resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body Request payload. + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VmmServers resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String vmmServerName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vmmServerName, context).block(); + } + + /** + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VmmServerInner createOrUpdate( - String resourceGroupName, String vmmServerName, VmmServerInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, vmmServerName, body, context).block(); + public VmmServerInner getByResourceGroup(String resourceGroupName, String vmmServerName) { + return getByResourceGroupWithResponse(resourceGroupName, vmmServerName, Context.NONE).getValue(); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmmServerName, Boolean force) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String vmmServerName, VmmServerInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -621,50 +529,40 @@ private Mono>> deleteWithResponseAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - this.client.getApiVersion(), - force, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vmmServerName, Boolean force, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String vmmServerName, VmmServerInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -673,269 +571,212 @@ private Mono>> deleteWithResponseAsync( if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vmmServerName, - this.client.getApiVersion(), - force, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, resource, accept, context); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmmServerName, Boolean force) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmmServerName, force); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, VmmServerInner> beginCreateOrUpdateAsync(String resourceGroupName, + String vmmServerName, VmmServerInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, vmmServerName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VmmServerInner.class, VmmServerInner.class, this.client.getContext()); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String vmmServerName, Boolean force, Context context) { + private PollerFlux, VmmServerInner> beginCreateOrUpdateAsync(String resourceGroupName, + String vmmServerName, VmmServerInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vmmServerName, force, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, vmmServerName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VmmServerInner.class, VmmServerInner.class, context); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmmServerName, Boolean force) { - return beginDeleteAsync(resourceGroupName, vmmServerName, force).getSyncPoller(); + public SyncPoller, VmmServerInner> beginCreateOrUpdate(String resourceGroupName, + String vmmServerName, VmmServerInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, vmmServerName, resource).getSyncPoller(); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String vmmServerName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, vmmServerName, force, context).getSyncPoller(); - } - - /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vmmServerName, Boolean force) { - return beginDeleteAsync(resourceGroupName, vmmServerName, force) - .last() - .flatMap(this.client::getLroFinalResultOrError); + public SyncPoller, VmmServerInner> beginCreateOrUpdate(String resourceGroupName, + String vmmServerName, VmmServerInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, vmmServerName, resource, context).getSyncPoller(); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 VmmServers resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vmmServerName) { - final Boolean force = null; - return beginDeleteAsync(resourceGroupName, vmmServerName, force) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String vmmServerName, + VmmServerInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, vmmServerName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the VmmServers resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String vmmServerName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, vmmServerName, force, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String vmmServerName, + VmmServerInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vmmServerName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmmServerName, Boolean force) { - deleteAsync(resourceGroupName, vmmServerName, force).block(); + public VmmServerInner createOrUpdate(String resourceGroupName, String vmmServerName, VmmServerInner resource) { + return createOrUpdateAsync(resourceGroupName, vmmServerName, resource).block(); } /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmmServerName) { - final Boolean force = null; - deleteAsync(resourceGroupName, vmmServerName, force).block(); - } - - /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Onboards the SCVmm fabric as an Azure VmmServer resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String vmmServerName, Boolean force, Context context) { - deleteAsync(resourceGroupName, vmmServerName, force, context).block(); + public VmmServerInner createOrUpdate(String resourceGroupName, String vmmServerName, VmmServerInner resource, + Context context) { + return createOrUpdateAsync(resourceGroupName, vmmServerName, resource, context).block(); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String vmmServerName, ResourcePatch body) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String vmmServerName, + VmmServerTagsUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - vmmServerName, - body, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vmmServerName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -943,77 +784,59 @@ private Mono>> updateWithResponseAsync( * @return the VmmServers resource definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String vmmServerName, ResourcePatch body, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String vmmServerName, + VmmServerTagsUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (vmmServerName == null) { return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - body.validate(); + properties.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - vmmServerName, - body, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vmmServerName, properties, accept, context); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VmmServerInner> beginUpdateAsync( - String resourceGroupName, String vmmServerName, ResourcePatch body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, vmmServerName, body); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - VmmServerInner.class, - VmmServerInner.class, - this.client.getContext()); + private PollerFlux, VmmServerInner> beginUpdateAsync(String resourceGroupName, + String vmmServerName, VmmServerTagsUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, vmmServerName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VmmServerInner.class, VmmServerInner.class, this.client.getContext()); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1021,40 +844,38 @@ private PollerFlux, VmmServerInner> beginUpdateAsync( * @return the {@link PollerFlux} for polling of the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VmmServerInner> beginUpdateAsync( - String resourceGroupName, String vmmServerName, ResourcePatch body, Context context) { + private PollerFlux, VmmServerInner> beginUpdateAsync(String resourceGroupName, + String vmmServerName, VmmServerTagsUpdate properties, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, vmmServerName, body, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VmmServerInner.class, VmmServerInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, vmmServerName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VmmServerInner.class, VmmServerInner.class, context); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VmmServerInner> beginUpdate( - String resourceGroupName, String vmmServerName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, vmmServerName, body).getSyncPoller(); + public SyncPoller, VmmServerInner> beginUpdate(String resourceGroupName, + String vmmServerName, VmmServerTagsUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, vmmServerName, properties).getSyncPoller(); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1062,35 +883,35 @@ public SyncPoller, VmmServerInner> beginUpdate( * @return the {@link SyncPoller} for polling of the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VmmServerInner> beginUpdate( - String resourceGroupName, String vmmServerName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, vmmServerName, body, context).getSyncPoller(); + public SyncPoller, VmmServerInner> beginUpdate(String resourceGroupName, + String vmmServerName, VmmServerTagsUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, vmmServerName, properties, context).getSyncPoller(); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VmmServers resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String vmmServerName, ResourcePatch body) { - return beginUpdateAsync(resourceGroupName, vmmServerName, body) - .last() + private Mono updateAsync(String resourceGroupName, String vmmServerName, + VmmServerTagsUpdate properties) { + return beginUpdateAsync(resourceGroupName, vmmServerName, properties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1098,35 +919,34 @@ private Mono updateAsync(String resourceGroupName, String vmmSer * @return the VmmServers resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String vmmServerName, ResourcePatch body, Context context) { - return beginUpdateAsync(resourceGroupName, vmmServerName, body, context) - .last() + private Mono updateAsync(String resourceGroupName, String vmmServerName, + VmmServerTagsUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, vmmServerName, properties, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VmmServerInner update(String resourceGroupName, String vmmServerName, ResourcePatch body) { - return updateAsync(resourceGroupName, vmmServerName, body).block(); + public VmmServerInner update(String resourceGroupName, String vmmServerName, VmmServerTagsUpdate properties) { + return updateAsync(resourceGroupName, vmmServerName, properties).block(); } /** * Updates the VmmServers resource. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param body VmmServers patch payload. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param properties The resource properties to be updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1134,457 +954,376 @@ public VmmServerInner update(String resourceGroupName, String vmmServerName, Res * @return the VmmServers resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VmmServerInner update(String resourceGroupName, String vmmServerName, ResourcePatch body, Context context) { - return updateAsync(resourceGroupName, vmmServerName, body, context).block(); + public VmmServerInner update(String resourceGroupName, String vmmServerName, VmmServerTagsUpdate properties, + Context context) { + return updateAsync(resourceGroupName, vmmServerName, properties, context).block(); } /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String vmmServerName, + Boolean force) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (vmmServerName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, force, vmmServerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String vmmServerName, + Boolean force, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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 (vmmServerName == null) { + return Mono.error(new IllegalArgumentException("Parameter vmmServerName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, force, vmmServerName, accept, context); } /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmmServerName, + Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmmServerName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmmServerName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vmmServerName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String vmmServerName, + Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, vmmServerName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vmmServerName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, vmmServerName, force).getSyncPoller(); } /** - * List of VmmServers in a subscription. - * + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vmmServerName, Boolean force, + Context context) { + return this.beginDeleteAsync(resourceGroupName, vmmServerName, force, context).getSyncPoller(); } /** - * List of VmmServers in a subscription. - * - * @param context The context to associate with this operation. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + private Mono deleteAsync(String resourceGroupName, String vmmServerName, Boolean force) { + return beginDeleteAsync(resourceGroupName, vmmServerName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VmmServers in a subscription. - * + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmmServerName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, vmmServerName, force).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VmmServers in a subscription. - * + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vmmServerName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, vmmServerName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List of VmmServers in a subscription. - * + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmmServerName) { + final Boolean force = null; + deleteAsync(resourceGroupName, vmmServerName, force).block(); } /** - * List of VmmServers in a subscription. - * + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vmmServerName, Boolean force, Context context) { + deleteAsync(resourceGroupName, vmmServerName, force, context).block(); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listBySubscriptionNext(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 nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(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.")); + 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 - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a VmmServer list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(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.")); + 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 - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServersImpl.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServersImpl.java index d37c1c505c3ce..8281ce9239927 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServersImpl.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/VmmServersImpl.java @@ -26,34 +26,47 @@ public VmmServersImpl(VmmServersClient innerClient, com.azure.resourcemanager.sc this.serviceManager = serviceManager; } - public VmmServer getByResourceGroup(String resourceGroupName, String vmmServerName) { - VmmServerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vmmServerName); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VmmServerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VmmServerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VmmServerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VmmServerImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String vmmServerName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vmmServerName, context); if (inner != null) { - return new VmmServerImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VmmServerImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vmmServerName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vmmServerName, context); + public VmmServer getByResourceGroup(String resourceGroupName, String vmmServerName) { + VmmServerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vmmServerName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new VmmServerImpl(inner.getValue(), this.manager())); + return new VmmServerImpl(inner, this.manager()); } else { return null; } } - public void delete(String resourceGroupName, String vmmServerName, Boolean force) { - this.serviceClient().delete(resourceGroupName, vmmServerName, force); - } - public void delete(String resourceGroupName, String vmmServerName) { this.serviceClient().delete(resourceGroupName, vmmServerName); } @@ -62,99 +75,59 @@ public void delete(String resourceGroupName, String vmmServerName, Boolean force this.serviceClient().delete(resourceGroupName, vmmServerName, force, context); } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new VmmServerImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new VmmServerImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new VmmServerImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new VmmServerImpl(inner1, this.manager())); - } - public VmmServer 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String vmmServerName = Utils.getValueFromIdByName(id, "vmmServers"); + String vmmServerName = ResourceManagerUtils.getValueFromIdByName(id, "vmmServers"); if (vmmServerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, vmmServerName, Context.NONE).getValue(); } 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String vmmServerName = Utils.getValueFromIdByName(id, "vmmServers"); + String vmmServerName = ResourceManagerUtils.getValueFromIdByName(id, "vmmServers"); if (vmmServerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, vmmServerName, context); } public void deleteById(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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String vmmServerName = Utils.getValueFromIdByName(id, "vmmServers"); + String vmmServerName = ResourceManagerUtils.getValueFromIdByName(id, "vmmServers"); if (vmmServerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); } Boolean localForce = null; this.delete(resourceGroupName, vmmServerName, localForce, Context.NONE); } public void deleteByIdWithResponse(String id, Boolean force, 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String vmmServerName = Utils.getValueFromIdByName(id, "vmmServers"); + String vmmServerName = ResourceManagerUtils.getValueFromIdByName(id, "vmmServers"); if (vmmServerName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmmServers'.", id))); } this.delete(resourceGroupName, vmmServerName, force, context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/package-info.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/package-info.java index 9cf3910742e10..5edf353caba89 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/package-info.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for ScvmmClient. SCVMM Client. */ +/** + * Package containing the implementations for ScvmmClient. + * SCVMM Client. + */ package com.azure.resourcemanager.scvmm.implementation; diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ActionType.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ActionType.java new file mode 100644 index 0000000000000..38039d2f24ac9 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ActionType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.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. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * 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 + 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() { + return values(ActionType.class); + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AllocationMethod.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AllocationMethod.java index fdcefe4165087..45edb8b68afc7 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AllocationMethod.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AllocationMethod.java @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for AllocationMethod. */ +/** + * Network address allocaiton method. + */ public final class AllocationMethod extends ExpandableStringEnum { - /** Static value Dynamic for AllocationMethod. */ + /** + * Static value Dynamic for AllocationMethod. + */ public static final AllocationMethod DYNAMIC = fromString("Dynamic"); - /** Static value Static for AllocationMethod. */ + /** + * Static value Static for AllocationMethod. + */ public static final AllocationMethod STATIC = fromString("Static"); + /** + * Creates a new instance of AllocationMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllocationMethod() { + } + /** * Creates or finds a AllocationMethod from its string representation. - * + * * @param name a name to look for. * @return the corresponding AllocationMethod. */ @@ -29,7 +44,7 @@ public static AllocationMethod fromString(String name) { /** * Gets known AllocationMethod values. - * + * * @return known AllocationMethod values. */ public static Collection values() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySet.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySet.java index 1fca8d2df70fb..97d424d842cb9 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySet.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySet.java @@ -10,116 +10,118 @@ import com.azure.resourcemanager.scvmm.fluent.models.AvailabilitySetInner; import java.util.Map; -/** An immutable client-side representation of AvailabilitySet. */ +/** + * An immutable client-side representation of AvailabilitySet. + */ public interface AvailabilitySet { /** * 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: The system data. - * - * @return the systemData value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - SystemData systemData(); + AvailabilitySetProperties properties(); /** * Gets the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** - * Gets the availabilitySetName property: Name of the availability set. - * - * @return the availabilitySetName value. - */ - String availabilitySetName(); - - /** - * Gets the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - String vmmServerId(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String provisioningState(); + SystemData systemData(); /** * 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.scvmm.fluent.models.AvailabilitySetInner object. - * + * * @return the inner object. */ AvailabilitySetInner innerModel(); - /** The entirety of the AvailabilitySet definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the AvailabilitySet definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCreate { } - /** The AvailabilitySet definition stages. */ + + /** + * The AvailabilitySet definition stages. + */ interface DefinitionStages { - /** The first stage of the AvailabilitySet definition. */ + /** + * The first stage of the AvailabilitySet definition. + */ interface Blank extends WithLocation { } - /** The stage of the AvailabilitySet definition allowing to specify location. */ + + /** + * The stage of the AvailabilitySet 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. */ @@ -127,134 +129,142 @@ 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 AvailabilitySet definition allowing to specify parent resource. */ + + /** + * The stage of the AvailabilitySet definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithCreate withExistingResourceGroup(String resourceGroupName); + WithExtendedLocation withExistingResourceGroup(String resourceGroupName); } + + /** + * The stage of the AvailabilitySet definition allowing to specify extendedLocation. + */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location.. + * + * @param extendedLocation The extended location. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** * The stage of the AvailabilitySet 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.WithExtendedLocation, - DefinitionStages.WithAvailabilitySetName, - DefinitionStages.WithVmmServerId { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ AvailabilitySet create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ AvailabilitySet create(Context context); } - /** The stage of the AvailabilitySet definition allowing to specify tags. */ + + /** + * The stage of the AvailabilitySet 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 AvailabilitySet definition allowing to specify extendedLocation. */ - interface WithExtendedLocation { - /** - * Specifies the extendedLocation property: The extended location.. - * - * @param extendedLocation The extended location. - * @return the next definition stage. - */ - WithCreate withExtendedLocation(ExtendedLocation extendedLocation); - } - /** The stage of the AvailabilitySet definition allowing to specify availabilitySetName. */ - interface WithAvailabilitySetName { - /** - * Specifies the availabilitySetName property: Name of the availability set.. - * - * @param availabilitySetName Name of the availability set. - * @return the next definition stage. - */ - WithCreate withAvailabilitySetName(String availabilitySetName); - } - /** The stage of the AvailabilitySet definition allowing to specify vmmServerId. */ - interface WithVmmServerId { + + /** + * The stage of the AvailabilitySet definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.. - * - * @param vmmServerId ARM Id of the vmmServer resource in which this resource resides. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withVmmServerId(String vmmServerId); + WithCreate withProperties(AvailabilitySetProperties properties); } } + /** * Begins update for the AvailabilitySet resource. - * + * * @return the stage of resource update. */ AvailabilitySet.Update update(); - /** The template for AvailabilitySet update. */ + /** + * The template for AvailabilitySet update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ AvailabilitySet apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ AvailabilitySet apply(Context context); } - /** The AvailabilitySet update stages. */ + + /** + * The AvailabilitySet update stages. + */ interface UpdateStages { - /** The stage of the AvailabilitySet update allowing to specify tags. */ + /** + * The stage of the AvailabilitySet update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ AvailabilitySet 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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetListItem.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetListItem.java index d2fac544cb93b..96d7ba9ef59ea 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetListItem.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetListItem.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Availability Set model. */ +/** + * Availability Set model. + */ @Fluent public final class AvailabilitySetListItem { /* @@ -22,9 +24,15 @@ public final class AvailabilitySetListItem { @JsonProperty(value = "name") private String name; + /** + * Creates an instance of AvailabilitySetListItem class. + */ + public AvailabilitySetListItem() { + } + /** * Get the id property: Gets the ARM Id of the microsoft.scvmm/availabilitySets resource. - * + * * @return the id value. */ public String id() { @@ -33,7 +41,7 @@ public String id() { /** * Set the id property: Gets the ARM Id of the microsoft.scvmm/availabilitySets resource. - * + * * @param id the id value to set. * @return the AvailabilitySetListItem object itself. */ @@ -44,7 +52,7 @@ public AvailabilitySetListItem withId(String id) { /** * Get the name property: Gets or sets the name of the availability set. - * + * * @return the name value. */ public String name() { @@ -53,7 +61,7 @@ public String name() { /** * Set the name property: Gets or sets the name of the availability set. - * + * * @param name the name value to set. * @return the AvailabilitySetListItem object itself. */ @@ -64,7 +72,7 @@ public AvailabilitySetListItem withName(String name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetListResult.java index 9f72c9e2423be..b464934c80309 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetListResult.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetListResult.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.scvmm.fluent.models.AvailabilitySetInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of AvailabilitySets. */ +/** + * The response of a AvailabilitySet list operation. + */ @Fluent public final class AvailabilitySetListResult { /* - * List of AvailabilitySets. + * The AvailabilitySet items on this page */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", required = true) private List value; /* - * Url to follow for getting next page of resources. + * The link to the next page of items */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: List of AvailabilitySets. - * + * Creates an instance of AvailabilitySetListResult class. + */ + public AvailabilitySetListResult() { + } + + /** + * Get the value property: The AvailabilitySet items on this page. + * * @return the value value. */ public List value() { @@ -34,8 +43,8 @@ public List value() { } /** - * Set the value property: List of AvailabilitySets. - * + * Set the value property: The AvailabilitySet items on this page. + * * @param value the value value to set. * @return the AvailabilitySetListResult object itself. */ @@ -45,8 +54,8 @@ public AvailabilitySetListResult withValue(List value) { } /** - * Get the nextLink property: Url to follow for getting next page of resources. - * + * Get the nextLink property: The link to the next page of items. + * * @return the nextLink value. */ public String nextLink() { @@ -54,8 +63,8 @@ public String nextLink() { } /** - * Set the nextLink property: Url to follow for getting next page of resources. - * + * Set the nextLink property: The link to the next page of items. + * * @param nextLink the nextLink value to set. * @return the AvailabilitySetListResult object itself. */ @@ -66,12 +75,17 @@ public AvailabilitySetListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AvailabilitySetListResult")); + } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(AvailabilitySetListResult.class); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/AvailabilitySetProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetProperties.java similarity index 81% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/AvailabilitySetProperties.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetProperties.java index 16bb3669ea231..2a74f065f3673 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/AvailabilitySetProperties.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetProperties.java @@ -2,12 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.scvmm.fluent.models; +package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class AvailabilitySetProperties { /* @@ -23,14 +25,20 @@ public final class AvailabilitySetProperties { private String vmmServerId; /* - * Gets or sets the provisioning state. + * Provisioning state of the resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** + * Creates an instance of AvailabilitySetProperties class. + */ + public AvailabilitySetProperties() { + } /** * Get the availabilitySetName property: Name of the availability set. - * + * * @return the availabilitySetName value. */ public String availabilitySetName() { @@ -39,7 +47,7 @@ public String availabilitySetName() { /** * Set the availabilitySetName property: Name of the availability set. - * + * * @param availabilitySetName the availabilitySetName value to set. * @return the AvailabilitySetProperties object itself. */ @@ -50,7 +58,7 @@ public AvailabilitySetProperties withAvailabilitySetName(String availabilitySetN /** * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * + * * @return the vmmServerId value. */ public String vmmServerId() { @@ -59,7 +67,7 @@ public String vmmServerId() { /** * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * + * * @param vmmServerId the vmmServerId value to set. * @return the AvailabilitySetProperties object itself. */ @@ -69,17 +77,17 @@ public AvailabilitySetProperties withVmmServerId(String vmmServerId) { } /** - * Get the provisioningState property: Gets or sets the provisioning state. - * + * Get the provisioningState property: Provisioning state of the resource. + * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetTagsUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetTagsUpdate.java new file mode 100644 index 0000000000000..ebedb9f543a4b --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySetTagsUpdate.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.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The type used for updating tags in AvailabilitySet resources. + */ +@Fluent +public final class AvailabilitySetTagsUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Creates an instance of AvailabilitySetTagsUpdate class. + */ + public AvailabilitySetTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the AvailabilitySetTagsUpdate object itself. + */ + public AvailabilitySetTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySets.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySets.java index 0b27b75297745..2be72334b2e40 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySets.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/AvailabilitySets.java @@ -8,118 +8,106 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AvailabilitySets. */ +/** + * Resource collection API of AvailabilitySets. + */ public interface AvailabilitySets { /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of AvailabilitySets in a 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 the AvailabilitySets resource definition. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - AvailabilitySet getByResourceGroup(String resourceGroupName, String availabilitySetName); + PagedIterable list(); /** - * Implements AvailabilitySet GET method. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * List of AvailabilitySets in a 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 the AvailabilitySets resource definition along with {@link Response}. + * @return the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String availabilitySetName, Context context); + PagedIterable list(Context context); /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * List of AvailabilitySets in a 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 the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String availabilitySetName, Boolean force); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. + * List of AvailabilitySets in a 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 the response of a AvailabilitySet list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String availabilitySetName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deregisters the ScVmm availability set from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param availabilitySetName Name of the AvailabilitySet. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @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 AvailabilitySets resource definition along with {@link Response}. */ - void delete(String resourceGroupName, String availabilitySetName, Boolean force, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String availabilitySetResourceName, Context context); /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Implements AvailabilitySet GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedIterable}. + * @return the AvailabilitySets resource definition. */ - PagedIterable listByResourceGroup(String resourceGroupName); + AvailabilitySet getByResourceGroup(String resourceGroupName, String availabilitySetResourceName); /** - * List of AvailabilitySets in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of AvailabilitySets as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List of AvailabilitySets in a 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 list of AvailabilitySets as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + void delete(String resourceGroupName, String availabilitySetResourceName); /** - * List of AvailabilitySets in a subscription. - * + * Deregisters the ScVmm availability set from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param availabilitySetResourceName Name of the AvailabilitySet. + * @param force Forces the resource to be deleted. * @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 list of AvailabilitySets as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + void delete(String resourceGroupName, String availabilitySetResourceName, Boolean force, Context context); /** * Implements AvailabilitySet GET method. - * + * * @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. @@ -130,7 +118,7 @@ Response getByResourceGroupWithResponse( /** * Implements AvailabilitySet GET method. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,7 +130,7 @@ Response getByResourceGroupWithResponse( /** * Deregisters the ScVmm availability set from Azure. - * + * * @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. @@ -152,10 +140,9 @@ Response getByResourceGroupWithResponse( /** * Deregisters the ScVmm availability set from Azure. - * + * * @param id the resource ID. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param force Forces the resource to be deleted. * @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. @@ -165,7 +152,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new AvailabilitySet resource. - * + * * @param name resource name. * @return the first stage of the new AvailabilitySet definition. */ diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Checkpoint.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Checkpoint.java index df85ae7a2a055..0e9ee86559446 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Checkpoint.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Checkpoint.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class Checkpoint { /* @@ -34,9 +36,15 @@ public final class Checkpoint { @JsonProperty(value = "description") private String description; + /** + * Creates an instance of Checkpoint class. + */ + public Checkpoint() { + } + /** * Get the parentCheckpointId property: Gets ID of parent of the checkpoint. - * + * * @return the parentCheckpointId value. */ public String parentCheckpointId() { @@ -45,7 +53,7 @@ public String parentCheckpointId() { /** * Set the parentCheckpointId property: Gets ID of parent of the checkpoint. - * + * * @param parentCheckpointId the parentCheckpointId value to set. * @return the Checkpoint object itself. */ @@ -56,7 +64,7 @@ public Checkpoint withParentCheckpointId(String parentCheckpointId) { /** * Get the checkpointId property: Gets ID of the checkpoint. - * + * * @return the checkpointId value. */ public String checkpointId() { @@ -65,7 +73,7 @@ public String checkpointId() { /** * Set the checkpointId property: Gets ID of the checkpoint. - * + * * @param checkpointId the checkpointId value to set. * @return the Checkpoint object itself. */ @@ -76,7 +84,7 @@ public Checkpoint withCheckpointId(String checkpointId) { /** * Get the name property: Gets name of the checkpoint. - * + * * @return the name value. */ public String name() { @@ -85,7 +93,7 @@ public String name() { /** * Set the name property: Gets name of the checkpoint. - * + * * @param name the name value to set. * @return the Checkpoint object itself. */ @@ -96,7 +104,7 @@ public Checkpoint withName(String name) { /** * Get the description property: Gets description of the checkpoint. - * + * * @return the description value. */ public String description() { @@ -105,7 +113,7 @@ public String description() { /** * Set the description property: Gets description of the checkpoint. - * + * * @param description the description value to set. * @return the Checkpoint object itself. */ @@ -116,7 +124,7 @@ public Checkpoint withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Cloud.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Cloud.java index 1707591135bdf..b6e61833d81ae 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Cloud.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Cloud.java @@ -8,148 +8,120 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.CloudInner; -import java.util.List; import java.util.Map; -/** An immutable client-side representation of Cloud. */ +/** + * An immutable client-side representation of Cloud. + */ public interface Cloud { /** * 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: The system data. - * - * @return the systemData value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - SystemData systemData(); + CloudProperties properties(); /** * Gets the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** - * Gets the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - String inventoryItemId(); - - /** - * Gets the uuid property: Unique ID of the cloud. - * - * @return the uuid value. - */ - String uuid(); - - /** - * Gets the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - String vmmServerId(); - - /** - * Gets the cloudName property: Name of the cloud in VMMServer. - * - * @return the cloudName value. - */ - String cloudName(); - - /** - * Gets the cloudCapacity property: Capacity of the cloud. - * - * @return the cloudCapacity value. - */ - CloudCapacity cloudCapacity(); - - /** - * Gets the storageQoSPolicies property: List of QoS policies available for the cloud. - * - * @return the storageQoSPolicies value. - */ - List storageQoSPolicies(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String provisioningState(); + SystemData systemData(); /** * 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.scvmm.fluent.models.CloudInner object. - * + * * @return the inner object. */ CloudInner innerModel(); - /** The entirety of the Cloud definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithExtendedLocation, - DefinitionStages.WithCreate { + /** + * The entirety of the Cloud definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCreate { } - /** The Cloud definition stages. */ + + /** + * The Cloud definition stages. + */ interface DefinitionStages { - /** The first stage of the Cloud definition. */ + /** + * The first stage of the Cloud definition. + */ interface Blank extends WithLocation { } - /** The stage of the Cloud definition allowing to specify location. */ + + /** + * The stage of the Cloud 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. */ @@ -157,144 +129,142 @@ 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 Cloud definition allowing to specify parent resource. */ + + /** + * The stage of the Cloud definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. + * + * @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 Cloud definition allowing to specify extendedLocation. */ + + /** + * The stage of the Cloud definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** * Specifies the extendedLocation property: The extended location.. - * + * * @param extendedLocation The extended location. * @return the next definition stage. */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** * The stage of the Cloud 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.WithInventoryItemId, - DefinitionStages.WithUuid, - DefinitionStages.WithVmmServerId { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ Cloud create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Cloud create(Context context); } - /** The stage of the Cloud definition allowing to specify tags. */ + + /** + * The stage of the Cloud 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 Cloud definition allowing to specify inventoryItemId. */ - interface WithInventoryItemId { - /** - * Specifies the inventoryItemId property: Gets or sets the inventory Item ID for the resource.. - * - * @param inventoryItemId Gets or sets the inventory Item ID for the resource. - * @return the next definition stage. - */ - WithCreate withInventoryItemId(String inventoryItemId); - } - /** The stage of the Cloud definition allowing to specify uuid. */ - interface WithUuid { - /** - * Specifies the uuid property: Unique ID of the cloud.. - * - * @param uuid Unique ID of the cloud. - * @return the next definition stage. - */ - WithCreate withUuid(String uuid); - } - /** The stage of the Cloud definition allowing to specify vmmServerId. */ - interface WithVmmServerId { + + /** + * The stage of the Cloud definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.. - * - * @param vmmServerId ARM Id of the vmmServer resource in which this resource resides. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withVmmServerId(String vmmServerId); + WithCreate withProperties(CloudProperties properties); } } + /** * Begins update for the Cloud resource. - * + * * @return the stage of resource update. */ Cloud.Update update(); - /** The template for Cloud update. */ + /** + * The template for Cloud update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ Cloud apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Cloud apply(Context context); } - /** The Cloud update stages. */ + + /** + * The Cloud update stages. + */ interface UpdateStages { - /** The stage of the Cloud update allowing to specify tags. */ + /** + * The stage of the Cloud update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Cloud 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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudCapacity.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudCapacity.java index 6639bb7b937ea..d7aede0c97e07 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudCapacity.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudCapacity.java @@ -7,91 +7,98 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Cloud Capacity model. */ +/** + * Cloud Capacity model. + */ @Fluent public final class CloudCapacity { /* - * CPUCount specifies the maximum number of CPUs that can be allocated in - * the cloud. + * CPUCount specifies the maximum number of CPUs that can be allocated in the cloud. */ @JsonProperty(value = "cpuCount") - private Long cpuCount; + private Integer cpuCount; /* * MemoryMB specifies a memory usage limit in megabytes. */ @JsonProperty(value = "memoryMB") - private Long memoryMB; + private Integer memoryMB; /* * VMCount gives the max number of VMs that can be deployed in the cloud. */ @JsonProperty(value = "vmCount") - private Long vmCount; + private Integer vmCount; + + /** + * Creates an instance of CloudCapacity class. + */ + public CloudCapacity() { + } /** * Get the cpuCount property: CPUCount specifies the maximum number of CPUs that can be allocated in the cloud. - * + * * @return the cpuCount value. */ - public Long cpuCount() { + public Integer cpuCount() { return this.cpuCount; } /** * Set the cpuCount property: CPUCount specifies the maximum number of CPUs that can be allocated in the cloud. - * + * * @param cpuCount the cpuCount value to set. * @return the CloudCapacity object itself. */ - public CloudCapacity withCpuCount(Long cpuCount) { + public CloudCapacity withCpuCount(Integer cpuCount) { this.cpuCount = cpuCount; return this; } /** * Get the memoryMB property: MemoryMB specifies a memory usage limit in megabytes. - * + * * @return the memoryMB value. */ - public Long memoryMB() { + public Integer memoryMB() { return this.memoryMB; } /** * Set the memoryMB property: MemoryMB specifies a memory usage limit in megabytes. - * + * * @param memoryMB the memoryMB value to set. * @return the CloudCapacity object itself. */ - public CloudCapacity withMemoryMB(Long memoryMB) { + public CloudCapacity withMemoryMB(Integer memoryMB) { this.memoryMB = memoryMB; return this; } /** * Get the vmCount property: VMCount gives the max number of VMs that can be deployed in the cloud. - * + * * @return the vmCount value. */ - public Long vmCount() { + public Integer vmCount() { return this.vmCount; } /** * Set the vmCount property: VMCount gives the max number of VMs that can be deployed in the cloud. - * + * * @param vmCount the vmCount value to set. * @return the CloudCapacity object itself. */ - public CloudCapacity withVmCount(Long vmCount) { + public CloudCapacity withVmCount(Integer vmCount) { this.vmCount = vmCount; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudInventoryItem.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudInventoryItem.java index dd97551cbf771..a7c2a5b1ff471 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudInventoryItem.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudInventoryItem.java @@ -5,18 +5,25 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Cloud inventory item. */ +/** + * The Cloud inventory item. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inventoryType") @JsonTypeName("Cloud") @Immutable public final class CloudInventoryItem extends InventoryItemProperties { + /** + * Creates an instance of CloudInventoryItem class. + */ + public CloudInventoryItem() { + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudListResult.java index 82cb0707bb5a0..c612f247f6ba6 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudListResult.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudListResult.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.scvmm.fluent.models.CloudInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of Clouds. */ +/** + * The response of a Cloud list operation. + */ @Fluent public final class CloudListResult { /* - * List of Clouds. + * The Cloud items on this page */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", required = true) private List value; /* - * Url to follow for getting next page of resources. + * The link to the next page of items */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: List of Clouds. - * + * Creates an instance of CloudListResult class. + */ + public CloudListResult() { + } + + /** + * Get the value property: The Cloud items on this page. + * * @return the value value. */ public List value() { @@ -34,8 +43,8 @@ public List value() { } /** - * Set the value property: List of Clouds. - * + * Set the value property: The Cloud items on this page. + * * @param value the value value to set. * @return the CloudListResult object itself. */ @@ -45,8 +54,8 @@ public CloudListResult withValue(List value) { } /** - * Get the nextLink property: Url to follow for getting next page of resources. - * + * Get the nextLink property: The link to the next page of items. + * * @return the nextLink value. */ public String nextLink() { @@ -54,8 +63,8 @@ public String nextLink() { } /** - * Set the nextLink property: Url to follow for getting next page of resources. - * + * Set the nextLink property: The link to the next page of items. + * * @param nextLink the nextLink value to set. * @return the CloudListResult object itself. */ @@ -66,12 +75,17 @@ public CloudListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model CloudListResult")); + } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(CloudListResult.class); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/CloudProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudProperties.java similarity index 78% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/CloudProperties.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudProperties.java index feed0e6a045ca..d59f603554899 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/CloudProperties.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudProperties.java @@ -2,15 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.scvmm.fluent.models; +package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.scvmm.models.CloudCapacity; -import com.azure.resourcemanager.scvmm.models.StorageQoSPolicy; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class CloudProperties { /* @@ -32,7 +32,7 @@ public final class CloudProperties { private String vmmServerId; /* - * Name of the cloud in VMMServer. + * Name of the cloud in VmmServer. */ @JsonProperty(value = "cloudName", access = JsonProperty.Access.WRITE_ONLY) private String cloudName; @@ -47,17 +47,23 @@ public final class CloudProperties { * List of QoS policies available for the cloud. */ @JsonProperty(value = "storageQoSPolicies", access = JsonProperty.Access.WRITE_ONLY) - private List storageQoSPolicies; + private List storageQosPolicies; /* - * Gets or sets the provisioning state. + * Provisioning state of the resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** + * Creates an instance of CloudProperties class. + */ + public CloudProperties() { + } /** * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * + * * @return the inventoryItemId value. */ public String inventoryItemId() { @@ -66,7 +72,7 @@ public String inventoryItemId() { /** * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * + * * @param inventoryItemId the inventoryItemId value to set. * @return the CloudProperties object itself. */ @@ -77,7 +83,7 @@ public CloudProperties withInventoryItemId(String inventoryItemId) { /** * Get the uuid property: Unique ID of the cloud. - * + * * @return the uuid value. */ public String uuid() { @@ -86,7 +92,7 @@ public String uuid() { /** * Set the uuid property: Unique ID of the cloud. - * + * * @param uuid the uuid value to set. * @return the CloudProperties object itself. */ @@ -97,7 +103,7 @@ public CloudProperties withUuid(String uuid) { /** * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * + * * @return the vmmServerId value. */ public String vmmServerId() { @@ -106,7 +112,7 @@ public String vmmServerId() { /** * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * + * * @param vmmServerId the vmmServerId value to set. * @return the CloudProperties object itself. */ @@ -116,8 +122,8 @@ public CloudProperties withVmmServerId(String vmmServerId) { } /** - * Get the cloudName property: Name of the cloud in VMMServer. - * + * Get the cloudName property: Name of the cloud in VmmServer. + * * @return the cloudName value. */ public String cloudName() { @@ -126,7 +132,7 @@ public String cloudName() { /** * Get the cloudCapacity property: Capacity of the cloud. - * + * * @return the cloudCapacity value. */ public CloudCapacity cloudCapacity() { @@ -134,34 +140,34 @@ public CloudCapacity cloudCapacity() { } /** - * Get the storageQoSPolicies property: List of QoS policies available for the cloud. - * - * @return the storageQoSPolicies value. + * Get the storageQosPolicies property: List of QoS policies available for the cloud. + * + * @return the storageQosPolicies value. */ - public List storageQoSPolicies() { - return this.storageQoSPolicies; + public List storageQosPolicies() { + return this.storageQosPolicies; } /** - * Get the provisioningState property: Gets or sets the provisioning state. - * + * Get the provisioningState property: Provisioning state of the resource. + * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (cloudCapacity() != null) { cloudCapacity().validate(); } - if (storageQoSPolicies() != null) { - storageQoSPolicies().forEach(e -> e.validate()); + if (storageQosPolicies() != null) { + storageQosPolicies().forEach(e -> e.validate()); } } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourcePatch.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudTagsUpdate.java similarity index 75% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourcePatch.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudTagsUpdate.java index 7fcdbc35ddb94..0671cd6ce1dad 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourcePatch.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CloudTagsUpdate.java @@ -9,9 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Object containing tags updates for patch operations. */ +/** + * The type used for updating tags in Cloud resources. + */ @Fluent -public final class ResourcePatch { +public final class CloudTagsUpdate { /* * Resource tags. */ @@ -19,9 +21,15 @@ public final class ResourcePatch { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** + * Creates an instance of CloudTagsUpdate class. + */ + public CloudTagsUpdate() { + } + /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -30,18 +38,18 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. - * @return the ResourcePatch object itself. + * @return the CloudTagsUpdate object itself. */ - public ResourcePatch withTags(Map tags) { + public CloudTagsUpdate withTags(Map tags) { this.tags = tags; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Clouds.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Clouds.java index 779d9e35f7a54..d315833b2f9cd 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Clouds.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Clouds.java @@ -8,117 +8,105 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Clouds. */ +/** + * Resource collection API of Clouds. + */ public interface Clouds { /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of Clouds in a 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 the Clouds resource definition. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - Cloud getByResourceGroup(String resourceGroupName, String cloudName); + PagedIterable list(); /** - * Implements Cloud GET method. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * List of Clouds in a 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 the Clouds resource definition along with {@link Response}. + * @return the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String cloudName, Context context); + PagedIterable list(Context context); /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * List of Clouds in a 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 the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String cloudName, Boolean force); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. + * List of Clouds in a 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 the response of a Cloud list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String cloudName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deregisters the ScVmm fabric cloud from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param cloudName Name of the Cloud. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @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 Clouds resource definition along with {@link Response}. */ - void delete(String resourceGroupName, String cloudName, Boolean force, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String cloudResourceName, Context context); /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Implements Cloud GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedIterable}. + * @return the Clouds resource definition. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Cloud getByResourceGroup(String resourceGroupName, String cloudResourceName); /** - * List of Clouds in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Clouds as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List of Clouds in a 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 list of Clouds as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + void delete(String resourceGroupName, String cloudResourceName); /** - * List of Clouds in a subscription. - * + * Deregisters the ScVmm fabric cloud from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudResourceName Name of the Cloud. + * @param force Forces the resource to be deleted. * @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 list of Clouds as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + void delete(String resourceGroupName, String cloudResourceName, Boolean force, Context context); /** * Implements Cloud GET method. - * + * * @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. @@ -129,7 +117,7 @@ public interface Clouds { /** * Implements Cloud GET method. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -141,7 +129,7 @@ public interface Clouds { /** * Deregisters the ScVmm fabric cloud from Azure. - * + * * @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. @@ -151,10 +139,9 @@ public interface Clouds { /** * Deregisters the ScVmm fabric cloud from Azure. - * + * * @param id the resource ID. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param force Forces the resource to be deleted. * @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. @@ -164,7 +151,7 @@ public interface Clouds { /** * Begins definition for a new Cloud resource. - * + * * @param name resource name. * @return the first stage of the new Cloud definition. */ diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CreateDiffDisk.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CreateDiffDisk.java index 70a6e053c77a8..cd8eee9c5a0e0 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CreateDiffDisk.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/CreateDiffDisk.java @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CreateDiffDisk. */ +/** + * Create diff disk. + */ public final class CreateDiffDisk extends ExpandableStringEnum { - /** Static value false for CreateDiffDisk. */ + /** + * Static value true for CreateDiffDisk. + */ + public static final CreateDiffDisk TRUE = fromString("true"); + + /** + * Static value false for CreateDiffDisk. + */ public static final CreateDiffDisk FALSE = fromString("false"); - /** Static value true for CreateDiffDisk. */ - public static final CreateDiffDisk TRUE = fromString("true"); + /** + * Creates a new instance of CreateDiffDisk value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CreateDiffDisk() { + } /** * Creates or finds a CreateDiffDisk from its string representation. - * + * * @param name a name to look for. * @return the corresponding CreateDiffDisk. */ @@ -29,7 +44,7 @@ public static CreateDiffDisk fromString(String name) { /** * Gets known CreateDiffDisk values. - * + * * @return known CreateDiffDisk values. */ public static Collection values() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/DynamicMemoryEnabled.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/DynamicMemoryEnabled.java index 2350f315b0647..9b8e604a63e40 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/DynamicMemoryEnabled.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/DynamicMemoryEnabled.java @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DynamicMemoryEnabled. */ +/** + * Dynamic memory enabled. + */ public final class DynamicMemoryEnabled extends ExpandableStringEnum { - /** Static value false for DynamicMemoryEnabled. */ + /** + * Static value true for DynamicMemoryEnabled. + */ + public static final DynamicMemoryEnabled TRUE = fromString("true"); + + /** + * Static value false for DynamicMemoryEnabled. + */ public static final DynamicMemoryEnabled FALSE = fromString("false"); - /** Static value true for DynamicMemoryEnabled. */ - public static final DynamicMemoryEnabled TRUE = fromString("true"); + /** + * Creates a new instance of DynamicMemoryEnabled value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DynamicMemoryEnabled() { + } /** * Creates or finds a DynamicMemoryEnabled from its string representation. - * + * * @param name a name to look for. * @return the corresponding DynamicMemoryEnabled. */ @@ -29,7 +44,7 @@ public static DynamicMemoryEnabled fromString(String name) { /** * Gets known DynamicMemoryEnabled values. - * + * * @return known DynamicMemoryEnabled values. */ public static Collection values() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ExtendedLocation.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ExtendedLocation.java index c28f2b95619ba..e6a71f421f528 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ExtendedLocation.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ExtendedLocation.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The extended location. */ +/** + * The extended location. + */ @Fluent public final class ExtendedLocation { /* @@ -22,9 +24,15 @@ public final class ExtendedLocation { @JsonProperty(value = "name") private String name; + /** + * Creates an instance of ExtendedLocation class. + */ + public ExtendedLocation() { + } + /** * Get the type property: The extended location type. - * + * * @return the type value. */ public String type() { @@ -33,7 +41,7 @@ public String type() { /** * Set the type property: The extended location type. - * + * * @param type the type value to set. * @return the ExtendedLocation object itself. */ @@ -44,7 +52,7 @@ public ExtendedLocation withType(String type) { /** * Get the name property: The extended location name. - * + * * @return the name value. */ public String name() { @@ -53,7 +61,7 @@ public String name() { /** * Set the name property: The extended location name. - * + * * @param name the name value to set. * @return the ExtendedLocation object itself. */ @@ -64,7 +72,7 @@ public ExtendedLocation withName(String name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgent.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgent.java new file mode 100644 index 0000000000000..2e600cacb0b90 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgent.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.scvmm.fluent.models.GuestAgentInner; + +/** + * An immutable client-side representation of GuestAgent. + */ +public interface GuestAgent { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + GuestAgentProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.scvmm.fluent.models.GuestAgentInner object. + * + * @return the inner object. + */ + GuestAgentInner innerModel(); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgentListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgentListResult.java new file mode 100644 index 0000000000000..4b308f508637e --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgentListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.scvmm.fluent.models.GuestAgentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a GuestAgent list operation. + */ +@Fluent +public final class GuestAgentListResult { + /* + * The GuestAgent items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of GuestAgentListResult class. + */ + public GuestAgentListResult() { + } + + /** + * Get the value property: The GuestAgent items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The GuestAgent items on this page. + * + * @param value the value value to set. + * @return the GuestAgentListResult object itself. + */ + public GuestAgentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the GuestAgentListResult object itself. + */ + public GuestAgentListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model GuestAgentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GuestAgentListResult.class); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgentProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgentProperties.java new file mode 100644 index 0000000000000..12ae333e3e9c7 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgentProperties.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the resource properties. + */ +@Fluent +public final class GuestAgentProperties { + /* + * Gets a unique identifier for this resource. + */ + @JsonProperty(value = "uuid", access = JsonProperty.Access.WRITE_ONLY) + private String uuid; + + /* + * Username / Password Credentials to provision guest agent. + */ + @JsonProperty(value = "credentials") + private GuestCredential credentials; + + /* + * HTTP Proxy configuration for the VM. + */ + @JsonProperty(value = "httpProxyConfig") + private HttpProxyConfiguration httpProxyConfig; + + /* + * Gets or sets the guest agent provisioning action. + */ + @JsonProperty(value = "provisioningAction") + private ProvisioningAction provisioningAction; + + /* + * Gets the guest agent status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Gets the name of the corresponding resource in Kubernetes. + */ + @JsonProperty(value = "customResourceName", access = JsonProperty.Access.WRITE_ONLY) + private String customResourceName; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Creates an instance of GuestAgentProperties class. + */ + public GuestAgentProperties() { + } + + /** + * Get the uuid property: Gets a unique identifier for this resource. + * + * @return the uuid value. + */ + public String uuid() { + return this.uuid; + } + + /** + * Get the credentials property: Username / Password Credentials to provision guest agent. + * + * @return the credentials value. + */ + public GuestCredential credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Username / Password Credentials to provision guest agent. + * + * @param credentials the credentials value to set. + * @return the GuestAgentProperties object itself. + */ + public GuestAgentProperties withCredentials(GuestCredential credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the httpProxyConfig property: HTTP Proxy configuration for the VM. + * + * @return the httpProxyConfig value. + */ + public HttpProxyConfiguration httpProxyConfig() { + return this.httpProxyConfig; + } + + /** + * Set the httpProxyConfig property: HTTP Proxy configuration for the VM. + * + * @param httpProxyConfig the httpProxyConfig value to set. + * @return the GuestAgentProperties object itself. + */ + public GuestAgentProperties withHttpProxyConfig(HttpProxyConfiguration httpProxyConfig) { + this.httpProxyConfig = httpProxyConfig; + return this; + } + + /** + * Get the provisioningAction property: Gets or sets the guest agent provisioning action. + * + * @return the provisioningAction value. + */ + public ProvisioningAction provisioningAction() { + return this.provisioningAction; + } + + /** + * Set the provisioningAction property: Gets or sets the guest agent provisioning action. + * + * @param provisioningAction the provisioningAction value to set. + * @return the GuestAgentProperties object itself. + */ + public GuestAgentProperties withProvisioningAction(ProvisioningAction provisioningAction) { + this.provisioningAction = provisioningAction; + return this; + } + + /** + * Get the status property: Gets the guest agent status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes. + * + * @return the customResourceName value. + */ + public String customResourceName() { + return this.customResourceName; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + if (httpProxyConfig() != null) { + httpProxyConfig().validate(); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgents.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgents.java new file mode 100644 index 0000000000000..d970ac5b3cfe0 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestAgents.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.scvmm.fluent.models.GuestAgentInner; + +/** + * Resource collection API of GuestAgents. + */ +public interface GuestAgents { + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a GuestAgent list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByVirtualMachineInstance(String resourceUri); + + /** + * Returns the list of GuestAgent of the given vm. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 response of a GuestAgent list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByVirtualMachineInstance(String resourceUri, Context context); + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 defines the GuestAgent along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Implements GuestAgent GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. + */ + GuestAgent get(String resourceUri); + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the GuestAgent. + */ + GuestAgent create(String resourceUri, GuestAgentInner resource); + + /** + * Create Or Update GuestAgent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @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 defines the GuestAgent. + */ + GuestAgent create(String resourceUri, GuestAgentInner resource, Context context); + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 Response}. + */ + Response deleteWithResponse(String resourceUri, Context context); + + /** + * Implements GuestAgent DELETE method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestCredential.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestCredential.java new file mode 100644 index 0000000000000..aa98b95bbf860 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/GuestCredential.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Username / Password Credentials to connect to guest. + */ +@Fluent +public final class GuestCredential { + /* + * Gets or sets username to connect with the guest. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /* + * Gets or sets the password to connect with the guest. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** + * Creates an instance of GuestCredential class. + */ + public GuestCredential() { + } + + /** + * Get the username property: Gets or sets username to connect with the guest. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Gets or sets username to connect with the guest. + * + * @param username the username value to set. + * @return the GuestCredential object itself. + */ + public GuestCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Gets or sets the password to connect with the guest. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Gets or sets the password to connect with the guest. + * + * @param password the password value to set. + * @return the GuestCredential object itself. + */ + public GuestCredential withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (username() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property username in model GuestCredential")); + } + if (password() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property password in model GuestCredential")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GuestCredential.class); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HardwareProfile.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HardwareProfile.java index 1b8da7e567827..5dbd9f2ec2f07 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HardwareProfile.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HardwareProfile.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class HardwareProfile { /* @@ -23,8 +25,7 @@ public final class HardwareProfile { private Integer cpuCount; /* - * Gets or sets a value indicating whether to enable processor - * compatibility mode for live migration of VMs. + * Gets or sets a value indicating whether to enable processor compatibility mode for live migration of VMs. */ @JsonProperty(value = "limitCpuForMigration") private LimitCpuForMigration limitCpuForMigration; @@ -50,12 +51,18 @@ public final class HardwareProfile { /* * Gets highly available property. */ - @JsonProperty(value = "isHighlyAvailable") - private String isHighlyAvailable; + @JsonProperty(value = "isHighlyAvailable", access = JsonProperty.Access.WRITE_ONLY) + private IsHighlyAvailable isHighlyAvailable; + + /** + * Creates an instance of HardwareProfile class. + */ + public HardwareProfile() { + } /** * Get the memoryMB property: MemoryMB is the size of a virtual machine's memory, in MB. - * + * * @return the memoryMB value. */ public Integer memoryMB() { @@ -64,7 +71,7 @@ public Integer memoryMB() { /** * Set the memoryMB property: MemoryMB is the size of a virtual machine's memory, in MB. - * + * * @param memoryMB the memoryMB value to set. * @return the HardwareProfile object itself. */ @@ -75,7 +82,7 @@ public HardwareProfile withMemoryMB(Integer memoryMB) { /** * Get the cpuCount property: Gets or sets the number of vCPUs for the vm. - * + * * @return the cpuCount value. */ public Integer cpuCount() { @@ -84,7 +91,7 @@ public Integer cpuCount() { /** * Set the cpuCount property: Gets or sets the number of vCPUs for the vm. - * + * * @param cpuCount the cpuCount value to set. * @return the HardwareProfile object itself. */ @@ -96,7 +103,7 @@ public HardwareProfile withCpuCount(Integer cpuCount) { /** * Get the limitCpuForMigration property: Gets or sets a value indicating whether to enable processor compatibility * mode for live migration of VMs. - * + * * @return the limitCpuForMigration value. */ public LimitCpuForMigration limitCpuForMigration() { @@ -106,7 +113,7 @@ public LimitCpuForMigration limitCpuForMigration() { /** * Set the limitCpuForMigration property: Gets or sets a value indicating whether to enable processor compatibility * mode for live migration of VMs. - * + * * @param limitCpuForMigration the limitCpuForMigration value to set. * @return the HardwareProfile object itself. */ @@ -117,7 +124,7 @@ public HardwareProfile withLimitCpuForMigration(LimitCpuForMigration limitCpuFor /** * Get the dynamicMemoryEnabled property: Gets or sets a value indicating whether to enable dynamic memory or not. - * + * * @return the dynamicMemoryEnabled value. */ public DynamicMemoryEnabled dynamicMemoryEnabled() { @@ -126,7 +133,7 @@ public DynamicMemoryEnabled dynamicMemoryEnabled() { /** * Set the dynamicMemoryEnabled property: Gets or sets a value indicating whether to enable dynamic memory or not. - * + * * @param dynamicMemoryEnabled the dynamicMemoryEnabled value to set. * @return the HardwareProfile object itself. */ @@ -137,7 +144,7 @@ public HardwareProfile withDynamicMemoryEnabled(DynamicMemoryEnabled dynamicMemo /** * Get the dynamicMemoryMaxMB property: Gets or sets the max dynamic memory for the vm. - * + * * @return the dynamicMemoryMaxMB value. */ public Integer dynamicMemoryMaxMB() { @@ -146,7 +153,7 @@ public Integer dynamicMemoryMaxMB() { /** * Set the dynamicMemoryMaxMB property: Gets or sets the max dynamic memory for the vm. - * + * * @param dynamicMemoryMaxMB the dynamicMemoryMaxMB value to set. * @return the HardwareProfile object itself. */ @@ -157,7 +164,7 @@ public HardwareProfile withDynamicMemoryMaxMB(Integer dynamicMemoryMaxMB) { /** * Get the dynamicMemoryMinMB property: Gets or sets the min dynamic memory for the vm. - * + * * @return the dynamicMemoryMinMB value. */ public Integer dynamicMemoryMinMB() { @@ -166,7 +173,7 @@ public Integer dynamicMemoryMinMB() { /** * Set the dynamicMemoryMinMB property: Gets or sets the min dynamic memory for the vm. - * + * * @param dynamicMemoryMinMB the dynamicMemoryMinMB value to set. * @return the HardwareProfile object itself. */ @@ -177,27 +184,16 @@ public HardwareProfile withDynamicMemoryMinMB(Integer dynamicMemoryMinMB) { /** * Get the isHighlyAvailable property: Gets highly available property. - * + * * @return the isHighlyAvailable value. */ - public String isHighlyAvailable() { + public IsHighlyAvailable isHighlyAvailable() { return this.isHighlyAvailable; } - /** - * Set the isHighlyAvailable property: Gets highly available property. - * - * @param isHighlyAvailable the isHighlyAvailable value to set. - * @return the HardwareProfile object itself. - */ - public HardwareProfile withIsHighlyAvailable(String isHighlyAvailable) { - this.isHighlyAvailable = isHighlyAvailable; - return this; - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HardwareProfileUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HardwareProfileUpdate.java deleted file mode 100644 index b12a5c7329e0b..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HardwareProfileUpdate.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines the resource properties. */ -@Fluent -public final class HardwareProfileUpdate { - /* - * MemoryMB is the size of a virtual machine's memory, in MB. - */ - @JsonProperty(value = "memoryMB") - private Integer memoryMB; - - /* - * Gets or sets the number of vCPUs for the vm. - */ - @JsonProperty(value = "cpuCount") - private Integer cpuCount; - - /* - * Gets or sets a value indicating whether to enable processor - * compatibility mode for live migration of VMs. - */ - @JsonProperty(value = "limitCpuForMigration") - private LimitCpuForMigration limitCpuForMigration; - - /* - * Gets or sets a value indicating whether to enable dynamic memory or not. - */ - @JsonProperty(value = "dynamicMemoryEnabled") - private DynamicMemoryEnabled dynamicMemoryEnabled; - - /* - * Gets or sets the max dynamic memory for the vm. - */ - @JsonProperty(value = "dynamicMemoryMaxMB") - private Integer dynamicMemoryMaxMB; - - /* - * Gets or sets the min dynamic memory for the vm. - */ - @JsonProperty(value = "dynamicMemoryMinMB") - private Integer dynamicMemoryMinMB; - - /** - * Get the memoryMB property: MemoryMB is the size of a virtual machine's memory, in MB. - * - * @return the memoryMB value. - */ - public Integer memoryMB() { - return this.memoryMB; - } - - /** - * Set the memoryMB property: MemoryMB is the size of a virtual machine's memory, in MB. - * - * @param memoryMB the memoryMB value to set. - * @return the HardwareProfileUpdate object itself. - */ - public HardwareProfileUpdate withMemoryMB(Integer memoryMB) { - this.memoryMB = memoryMB; - return this; - } - - /** - * Get the cpuCount property: Gets or sets the number of vCPUs for the vm. - * - * @return the cpuCount value. - */ - public Integer cpuCount() { - return this.cpuCount; - } - - /** - * Set the cpuCount property: Gets or sets the number of vCPUs for the vm. - * - * @param cpuCount the cpuCount value to set. - * @return the HardwareProfileUpdate object itself. - */ - public HardwareProfileUpdate withCpuCount(Integer cpuCount) { - this.cpuCount = cpuCount; - return this; - } - - /** - * Get the limitCpuForMigration property: Gets or sets a value indicating whether to enable processor compatibility - * mode for live migration of VMs. - * - * @return the limitCpuForMigration value. - */ - public LimitCpuForMigration limitCpuForMigration() { - return this.limitCpuForMigration; - } - - /** - * Set the limitCpuForMigration property: Gets or sets a value indicating whether to enable processor compatibility - * mode for live migration of VMs. - * - * @param limitCpuForMigration the limitCpuForMigration value to set. - * @return the HardwareProfileUpdate object itself. - */ - public HardwareProfileUpdate withLimitCpuForMigration(LimitCpuForMigration limitCpuForMigration) { - this.limitCpuForMigration = limitCpuForMigration; - return this; - } - - /** - * Get the dynamicMemoryEnabled property: Gets or sets a value indicating whether to enable dynamic memory or not. - * - * @return the dynamicMemoryEnabled value. - */ - public DynamicMemoryEnabled dynamicMemoryEnabled() { - return this.dynamicMemoryEnabled; - } - - /** - * Set the dynamicMemoryEnabled property: Gets or sets a value indicating whether to enable dynamic memory or not. - * - * @param dynamicMemoryEnabled the dynamicMemoryEnabled value to set. - * @return the HardwareProfileUpdate object itself. - */ - public HardwareProfileUpdate withDynamicMemoryEnabled(DynamicMemoryEnabled dynamicMemoryEnabled) { - this.dynamicMemoryEnabled = dynamicMemoryEnabled; - return this; - } - - /** - * Get the dynamicMemoryMaxMB property: Gets or sets the max dynamic memory for the vm. - * - * @return the dynamicMemoryMaxMB value. - */ - public Integer dynamicMemoryMaxMB() { - return this.dynamicMemoryMaxMB; - } - - /** - * Set the dynamicMemoryMaxMB property: Gets or sets the max dynamic memory for the vm. - * - * @param dynamicMemoryMaxMB the dynamicMemoryMaxMB value to set. - * @return the HardwareProfileUpdate object itself. - */ - public HardwareProfileUpdate withDynamicMemoryMaxMB(Integer dynamicMemoryMaxMB) { - this.dynamicMemoryMaxMB = dynamicMemoryMaxMB; - return this; - } - - /** - * Get the dynamicMemoryMinMB property: Gets or sets the min dynamic memory for the vm. - * - * @return the dynamicMemoryMinMB value. - */ - public Integer dynamicMemoryMinMB() { - return this.dynamicMemoryMinMB; - } - - /** - * Set the dynamicMemoryMinMB property: Gets or sets the min dynamic memory for the vm. - * - * @param dynamicMemoryMinMB the dynamicMemoryMinMB value to set. - * @return the HardwareProfileUpdate object itself. - */ - public HardwareProfileUpdate withDynamicMemoryMinMB(Integer dynamicMemoryMinMB) { - this.dynamicMemoryMinMB = dynamicMemoryMinMB; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HttpProxyConfiguration.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HttpProxyConfiguration.java new file mode 100644 index 0000000000000..c68e5cb23561c --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/HttpProxyConfiguration.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * HTTP Proxy configuration for the VM. + */ +@Fluent +public final class HttpProxyConfiguration { + /* + * Gets or sets httpsProxy url. + */ + @JsonProperty(value = "httpsProxy") + private String httpsProxy; + + /** + * Creates an instance of HttpProxyConfiguration class. + */ + public HttpProxyConfiguration() { + } + + /** + * Get the httpsProxy property: Gets or sets httpsProxy url. + * + * @return the httpsProxy value. + */ + public String httpsProxy() { + return this.httpsProxy; + } + + /** + * Set the httpsProxy property: Gets or sets httpsProxy url. + * + * @param httpsProxy the httpsProxy value to set. + * @return the HttpProxyConfiguration object itself. + */ + public HttpProxyConfiguration withHttpsProxy(String httpsProxy) { + this.httpsProxy = httpsProxy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InfrastructureProfile.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InfrastructureProfile.java new file mode 100644 index 0000000000000..6617eab89ff00 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InfrastructureProfile.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.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Specifies the vmmServer infrastructure specific settings for the virtual machine instance. + */ +@Fluent +public final class InfrastructureProfile { + /* + * Gets or sets the inventory Item ID for the resource. + */ + @JsonProperty(value = "inventoryItemId") + private String inventoryItemId; + + /* + * ARM Id of the vmmServer resource in which this resource resides. + */ + @JsonProperty(value = "vmmServerId") + private String vmmServerId; + + /* + * ARM Id of the cloud resource to use for deploying the vm. + */ + @JsonProperty(value = "cloudId") + private String cloudId; + + /* + * ARM Id of the template resource to use for deploying the vm. + */ + @JsonProperty(value = "templateId") + private String templateId; + + /* + * VMName is the name of VM on the SCVmm server. + */ + @JsonProperty(value = "vmName") + private String vmName; + + /* + * Unique ID of the virtual machine. + */ + @JsonProperty(value = "uuid") + private String uuid; + + /* + * Last restored checkpoint in the vm. + */ + @JsonProperty(value = "lastRestoredVMCheckpoint", access = JsonProperty.Access.WRITE_ONLY) + private Checkpoint lastRestoredVmCheckpoint; + + /* + * Checkpoints in the vm. + */ + @JsonProperty(value = "checkpoints") + private List checkpoints; + + /* + * Type of checkpoint supported for the vm. + */ + @JsonProperty(value = "checkpointType") + private String checkpointType; + + /* + * Gets or sets the generation for the vm. + */ + @JsonProperty(value = "generation") + private Integer generation; + + /* + * Gets or sets the bios guid for the vm. + */ + @JsonProperty(value = "biosGuid") + private String biosGuid; + + /** + * Creates an instance of InfrastructureProfile class. + */ + public InfrastructureProfile() { + } + + /** + * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. + * + * @return the inventoryItemId value. + */ + public String inventoryItemId() { + return this.inventoryItemId; + } + + /** + * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. + * + * @param inventoryItemId the inventoryItemId value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withInventoryItemId(String inventoryItemId) { + this.inventoryItemId = inventoryItemId; + return this; + } + + /** + * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. + * + * @return the vmmServerId value. + */ + public String vmmServerId() { + return this.vmmServerId; + } + + /** + * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. + * + * @param vmmServerId the vmmServerId value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withVmmServerId(String vmmServerId) { + this.vmmServerId = vmmServerId; + return this; + } + + /** + * Get the cloudId property: ARM Id of the cloud resource to use for deploying the vm. + * + * @return the cloudId value. + */ + public String cloudId() { + return this.cloudId; + } + + /** + * Set the cloudId property: ARM Id of the cloud resource to use for deploying the vm. + * + * @param cloudId the cloudId value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withCloudId(String cloudId) { + this.cloudId = cloudId; + return this; + } + + /** + * Get the templateId property: ARM Id of the template resource to use for deploying the vm. + * + * @return the templateId value. + */ + public String templateId() { + return this.templateId; + } + + /** + * Set the templateId property: ARM Id of the template resource to use for deploying the vm. + * + * @param templateId the templateId value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withTemplateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * Get the vmName property: VMName is the name of VM on the SCVmm server. + * + * @return the vmName value. + */ + public String vmName() { + return this.vmName; + } + + /** + * Set the vmName property: VMName is the name of VM on the SCVmm server. + * + * @param vmName the vmName value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withVmName(String vmName) { + this.vmName = vmName; + return this; + } + + /** + * Get the uuid property: Unique ID of the virtual machine. + * + * @return the uuid value. + */ + public String uuid() { + return this.uuid; + } + + /** + * Set the uuid property: Unique ID of the virtual machine. + * + * @param uuid the uuid value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withUuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get the lastRestoredVmCheckpoint property: Last restored checkpoint in the vm. + * + * @return the lastRestoredVmCheckpoint value. + */ + public Checkpoint lastRestoredVmCheckpoint() { + return this.lastRestoredVmCheckpoint; + } + + /** + * Get the checkpoints property: Checkpoints in the vm. + * + * @return the checkpoints value. + */ + public List checkpoints() { + return this.checkpoints; + } + + /** + * Set the checkpoints property: Checkpoints in the vm. + * + * @param checkpoints the checkpoints value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withCheckpoints(List checkpoints) { + this.checkpoints = checkpoints; + return this; + } + + /** + * Get the checkpointType property: Type of checkpoint supported for the vm. + * + * @return the checkpointType value. + */ + public String checkpointType() { + return this.checkpointType; + } + + /** + * Set the checkpointType property: Type of checkpoint supported for the vm. + * + * @param checkpointType the checkpointType value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withCheckpointType(String checkpointType) { + this.checkpointType = checkpointType; + return this; + } + + /** + * Get the generation property: Gets or sets the generation for the vm. + * + * @return the generation value. + */ + public Integer generation() { + return this.generation; + } + + /** + * Set the generation property: Gets or sets the generation for the vm. + * + * @param generation the generation value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withGeneration(Integer generation) { + this.generation = generation; + return this; + } + + /** + * Get the biosGuid property: Gets or sets the bios guid for the vm. + * + * @return the biosGuid value. + */ + public String biosGuid() { + return this.biosGuid; + } + + /** + * Set the biosGuid property: Gets or sets the bios guid for the vm. + * + * @param biosGuid the biosGuid value to set. + * @return the InfrastructureProfile object itself. + */ + public InfrastructureProfile withBiosGuid(String biosGuid) { + this.biosGuid = biosGuid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lastRestoredVmCheckpoint() != null) { + lastRestoredVmCheckpoint().validate(); + } + if (checkpoints() != null) { + checkpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItem.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItem.java index dab51031a1745..0506f1e2a251c 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItem.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItem.java @@ -8,145 +8,154 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemInner; -/** An immutable client-side representation of InventoryItem. */ +/** + * An immutable client-side representation of InventoryItem. + */ public interface InventoryItem { /** * 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: The system data. - * - * @return the systemData value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - SystemData systemData(); + InventoryItemProperties properties(); /** * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must * validate and persist this value. - * + * * @return the kind value. */ String kind(); /** - * Gets the managedResourceId property: Gets the tracked resource id corresponding to the inventory resource. - * - * @return the managedResourceId value. - */ - String managedResourceId(); - - /** - * Gets the uuid property: Gets the UUID (which is assigned by VMM) for the inventory item. - * - * @return the uuid value. - */ - String uuid(); - - /** - * Gets the inventoryItemName property: Gets the Managed Object name in VMM for the inventory item. - * - * @return the inventoryItemName value. - */ - String inventoryItemName(); - - /** - * Gets the provisioningState property: Gets the provisioning state. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String provisioningState(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.scvmm.fluent.models.InventoryItemInner object. - * + * * @return the inner object. */ InventoryItemInner innerModel(); - /** The entirety of the InventoryItem definition. */ + /** + * The entirety of the InventoryItem definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The InventoryItem definition stages. */ + + /** + * The InventoryItem definition stages. + */ interface DefinitionStages { - /** The first stage of the InventoryItem definition. */ + /** + * The first stage of the InventoryItem definition. + */ interface Blank extends WithParentResource { } - /** The stage of the InventoryItem definition allowing to specify parent resource. */ + + /** + * The stage of the InventoryItem definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, vmmServerName. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @return the next definition stage. */ WithCreate withExistingVmmServer(String resourceGroupName, String vmmServerName); } + /** * The stage of the InventoryItem 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.WithKind { + interface WithCreate extends DefinitionStages.WithProperties, DefinitionStages.WithKind { /** * Executes the create request. - * + * * @return the created resource. */ InventoryItem create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ InventoryItem create(Context context); } - /** The stage of the InventoryItem definition allowing to specify kind. */ + + /** + * The stage of the InventoryItem definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(InventoryItemProperties properties); + } + + /** + * The stage of the InventoryItem definition allowing to specify kind. + */ interface WithKind { /** * Specifies the kind property: Metadata used by portal/tooling/etc to render different UX experiences for * resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the * resource provider must validate and persist this value.. - * + * * @param kind Metadata used by portal/tooling/etc to render different UX experiences for resources of the - * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider - * must validate and persist this value. + * same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * @return the next definition stage. */ WithCreate withKind(String kind); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ InventoryItem 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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemDetails.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemDetails.java index a982e282f4c38..8b961dd084007 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemDetails.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemDetails.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class InventoryItemDetails { /* @@ -17,14 +19,20 @@ public final class InventoryItemDetails { private String inventoryItemId; /* - * Gets or sets the Managed Object name in VMM for the resource. + * Gets or sets the Managed Object name in Vmm for the resource. */ @JsonProperty(value = "inventoryItemName") private String inventoryItemName; + /** + * Creates an instance of InventoryItemDetails class. + */ + public InventoryItemDetails() { + } + /** * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * + * * @return the inventoryItemId value. */ public String inventoryItemId() { @@ -33,7 +41,7 @@ public String inventoryItemId() { /** * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * + * * @param inventoryItemId the inventoryItemId value to set. * @return the InventoryItemDetails object itself. */ @@ -43,8 +51,8 @@ public InventoryItemDetails withInventoryItemId(String inventoryItemId) { } /** - * Get the inventoryItemName property: Gets or sets the Managed Object name in VMM for the resource. - * + * Get the inventoryItemName property: Gets or sets the Managed Object name in Vmm for the resource. + * * @return the inventoryItemName value. */ public String inventoryItemName() { @@ -52,8 +60,8 @@ public String inventoryItemName() { } /** - * Set the inventoryItemName property: Gets or sets the Managed Object name in VMM for the resource. - * + * Set the inventoryItemName property: Gets or sets the Managed Object name in Vmm for the resource. + * * @param inventoryItemName the inventoryItemName value to set. * @return the InventoryItemDetails object itself. */ @@ -64,7 +72,7 @@ public InventoryItemDetails withInventoryItemName(String inventoryItemName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemsList.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemListResult.java similarity index 57% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemsList.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemListResult.java index fdb246a7e0fe0..aaecdad61a6c6 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemsList.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemListResult.java @@ -10,44 +10,32 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of InventoryItems. */ +/** + * The response of a InventoryItem list operation. + */ @Fluent -public final class InventoryItemsList { +public final class InventoryItemListResult { /* - * Url to follow for getting next page of InventoryItems. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /* - * Array of InventoryItems + * The InventoryItem items on this page */ @JsonProperty(value = "value", required = true) private List value; - /** - * Get the nextLink property: Url to follow for getting next page of InventoryItems. - * - * @return the nextLink value. + /* + * The link to the next page of items */ - public String nextLink() { - return this.nextLink; - } + @JsonProperty(value = "nextLink") + private String nextLink; /** - * Set the nextLink property: Url to follow for getting next page of InventoryItems. - * - * @param nextLink the nextLink value to set. - * @return the InventoryItemsList object itself. + * Creates an instance of InventoryItemListResult class. */ - public InventoryItemsList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; + public InventoryItemListResult() { } /** - * Get the value property: Array of InventoryItems. - * + * Get the value property: The InventoryItem items on this page. + * * @return the value value. */ public List value() { @@ -55,30 +43,49 @@ public List value() { } /** - * Set the value property: Array of InventoryItems. - * + * Set the value property: The InventoryItem items on this page. + * * @param value the value value to set. - * @return the InventoryItemsList object itself. + * @return the InventoryItemListResult object itself. */ - public InventoryItemsList withValue(List value) { + public InventoryItemListResult withValue(List value) { this.value = value; return this; } + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the InventoryItemListResult object itself. + */ + public InventoryItemListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model InventoryItemsList")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model InventoryItemListResult")); } else { value().forEach(e -> e.validate()); } } - private static final ClientLogger LOGGER = new ClientLogger(InventoryItemsList.class); + private static final ClientLogger LOGGER = new ClientLogger(InventoryItemListResult.class); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/InventoryItemProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemProperties.java similarity index 74% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/InventoryItemProperties.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemProperties.java index 7a5297045502f..e3f5ebad2db72 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/InventoryItemProperties.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItemProperties.java @@ -2,19 +2,17 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.scvmm.fluent.models; +package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.scvmm.models.CloudInventoryItem; -import com.azure.resourcemanager.scvmm.models.VirtualMachineInventoryItem; -import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateInventoryItem; -import com.azure.resourcemanager.scvmm.models.VirtualNetworkInventoryItem; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -23,10 +21,9 @@ @JsonTypeName("InventoryItemProperties") @JsonSubTypes({ @JsonSubTypes.Type(name = "Cloud", value = CloudInventoryItem.class), - @JsonSubTypes.Type(name = "VirtualNetwork", value = VirtualNetworkInventoryItem.class), + @JsonSubTypes.Type(name = "VirtualMachine", value = VirtualMachineInventoryItem.class), @JsonSubTypes.Type(name = "VirtualMachineTemplate", value = VirtualMachineTemplateInventoryItem.class), - @JsonSubTypes.Type(name = "VirtualMachine", value = VirtualMachineInventoryItem.class) -}) + @JsonSubTypes.Type(name = "VirtualNetwork", value = VirtualNetworkInventoryItem.class) }) @Immutable public class InventoryItemProperties { /* @@ -36,26 +33,32 @@ public class InventoryItemProperties { private String managedResourceId; /* - * Gets the UUID (which is assigned by VMM) for the inventory item. + * Gets the UUID (which is assigned by Vmm) for the inventory item. */ @JsonProperty(value = "uuid", access = JsonProperty.Access.WRITE_ONLY) private String uuid; /* - * Gets the Managed Object name in VMM for the inventory item. + * Gets the Managed Object name in Vmm for the inventory item. */ @JsonProperty(value = "inventoryItemName", access = JsonProperty.Access.WRITE_ONLY) private String inventoryItemName; /* - * Gets the provisioning state. + * Provisioning state of the resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** + * Creates an instance of InventoryItemProperties class. + */ + public InventoryItemProperties() { + } /** * Get the managedResourceId property: Gets the tracked resource id corresponding to the inventory resource. - * + * * @return the managedResourceId value. */ public String managedResourceId() { @@ -63,8 +66,8 @@ public String managedResourceId() { } /** - * Get the uuid property: Gets the UUID (which is assigned by VMM) for the inventory item. - * + * Get the uuid property: Gets the UUID (which is assigned by Vmm) for the inventory item. + * * @return the uuid value. */ public String uuid() { @@ -72,8 +75,8 @@ public String uuid() { } /** - * Get the inventoryItemName property: Gets the Managed Object name in VMM for the inventory item. - * + * Get the inventoryItemName property: Gets the Managed Object name in Vmm for the inventory item. + * * @return the inventoryItemName value. */ public String inventoryItemName() { @@ -81,17 +84,17 @@ public String inventoryItemName() { } /** - * Get the provisioningState property: Gets the provisioning state. - * + * Get the provisioningState property: Provisioning state of the resource. + * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItems.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItems.java index 86b9ac3b571c3..1cf6b5ba905ef 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItems.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryItems.java @@ -8,91 +8,93 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of InventoryItems. */ +/** + * Resource collection API of InventoryItems. + */ public interface InventoryItems { /** - * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return defines the inventory item. + * @return the response of a InventoryItem list operation as paginated response with {@link PagedIterable}. */ - InventoryItem get(String resourceGroupName, String vmmServerName, String inventoryItemName); + PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName); /** - * Shows an inventory item. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Returns the list of inventoryItems in the given VmmServer. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @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 defines the inventory item along with {@link Response}. + * @return the response of a InventoryItem list operation as paginated response with {@link PagedIterable}. */ - Response getWithResponse( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context); + PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName, Context context); /** - * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. + * Shows an inventory item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @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 defines the inventory item along with {@link Response}. */ - void delete(String resourceGroupName, String vmmServerName, String inventoryItemName); + Response getWithResponse(String resourceGroupName, String vmmServerName, + String inventoryItemResourceName, Context context); /** - * Deletes an inventoryItem. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param inventoryItemName Name of the inventoryItem. - * @param context The context to associate with this operation. + * Shows an inventory item. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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}. + * @return defines the inventory item. */ - Response deleteWithResponse( - String resourceGroupName, String vmmServerName, String inventoryItemName, Context context); + InventoryItem get(String resourceGroupName, String vmmServerName, String inventoryItemResourceName); /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * Deletes an inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. + * @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 list of InventoryItems as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName); + Response deleteWithResponse(String resourceGroupName, String vmmServerName, String inventoryItemResourceName, + Context context); /** - * Returns the list of inventoryItems in the given VMMServer. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param context The context to associate with this operation. + * Deletes an inventoryItem. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param inventoryItemResourceName Name of the inventoryItem. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of InventoryItems as paginated response with {@link PagedIterable}. */ - PagedIterable listByVmmServer(String resourceGroupName, String vmmServerName, Context context); + void delete(String resourceGroupName, String vmmServerName, String inventoryItemResourceName); /** * Shows an inventory item. - * + * * @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. @@ -103,7 +105,7 @@ Response deleteWithResponse( /** * Shows an inventory item. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -115,7 +117,7 @@ Response deleteWithResponse( /** * Deletes an inventoryItem. - * + * * @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. @@ -125,7 +127,7 @@ Response deleteWithResponse( /** * Deletes an inventoryItem. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,7 +139,7 @@ Response deleteWithResponse( /** * Begins definition for a new InventoryItem resource. - * + * * @param name resource name. * @return the first stage of the new InventoryItem definition. */ diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryType.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryType.java deleted file mode 100644 index 72abd618368c9..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/InventoryType.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.scvmm.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InventoryType. */ -public final class InventoryType extends ExpandableStringEnum { - /** Static value Cloud for InventoryType. */ - public static final InventoryType CLOUD = fromString("Cloud"); - - /** Static value VirtualNetwork for InventoryType. */ - public static final InventoryType VIRTUAL_NETWORK = fromString("VirtualNetwork"); - - /** Static value VirtualMachineTemplate for InventoryType. */ - public static final InventoryType VIRTUAL_MACHINE_TEMPLATE = fromString("VirtualMachineTemplate"); - - /** Static value VirtualMachine for InventoryType. */ - public static final InventoryType VIRTUAL_MACHINE = fromString("VirtualMachine"); - - /** - * Creates or finds a InventoryType from its string representation. - * - * @param name a name to look for. - * @return the corresponding InventoryType. - */ - @JsonCreator - public static InventoryType fromString(String name) { - return fromString(name, InventoryType.class); - } - - /** - * Gets known InventoryType values. - * - * @return known InventoryType values. - */ - public static Collection values() { - return values(InventoryType.class); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/IsCustomizable.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/IsCustomizable.java index bc2baf2f46925..878c76c3f32c1 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/IsCustomizable.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/IsCustomizable.java @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for IsCustomizable. */ +/** + * Customizable. + */ public final class IsCustomizable extends ExpandableStringEnum { - /** Static value false for IsCustomizable. */ + /** + * Static value true for IsCustomizable. + */ + public static final IsCustomizable TRUE = fromString("true"); + + /** + * Static value false for IsCustomizable. + */ public static final IsCustomizable FALSE = fromString("false"); - /** Static value true for IsCustomizable. */ - public static final IsCustomizable TRUE = fromString("true"); + /** + * Creates a new instance of IsCustomizable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsCustomizable() { + } /** * Creates or finds a IsCustomizable from its string representation. - * + * * @param name a name to look for. * @return the corresponding IsCustomizable. */ @@ -29,7 +44,7 @@ public static IsCustomizable fromString(String name) { /** * Gets known IsCustomizable values. - * + * * @return known IsCustomizable values. */ public static Collection values() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/IsHighlyAvailable.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/IsHighlyAvailable.java new file mode 100644 index 0000000000000..5f6dbd6d0846b --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/IsHighlyAvailable.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.scvmm.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Highly available. + */ +public final class IsHighlyAvailable extends ExpandableStringEnum { + /** + * Static value true for IsHighlyAvailable. + */ + public static final IsHighlyAvailable TRUE = fromString("true"); + + /** + * Static value false for IsHighlyAvailable. + */ + public static final IsHighlyAvailable FALSE = fromString("false"); + + /** + * Creates a new instance of IsHighlyAvailable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsHighlyAvailable() { + } + + /** + * Creates or finds a IsHighlyAvailable from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsHighlyAvailable. + */ + @JsonCreator + public static IsHighlyAvailable fromString(String name) { + return fromString(name, IsHighlyAvailable.class); + } + + /** + * Gets known IsHighlyAvailable values. + * + * @return known IsHighlyAvailable values. + */ + public static Collection values() { + return values(IsHighlyAvailable.class); + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/LimitCpuForMigration.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/LimitCpuForMigration.java index b8a2cd27553aa..d2a65574e4ec6 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/LimitCpuForMigration.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/LimitCpuForMigration.java @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for LimitCpuForMigration. */ +/** + * Limit CPU for migration. + */ public final class LimitCpuForMigration extends ExpandableStringEnum { - /** Static value false for LimitCpuForMigration. */ + /** + * Static value true for LimitCpuForMigration. + */ + public static final LimitCpuForMigration TRUE = fromString("true"); + + /** + * Static value false for LimitCpuForMigration. + */ public static final LimitCpuForMigration FALSE = fromString("false"); - /** Static value true for LimitCpuForMigration. */ - public static final LimitCpuForMigration TRUE = fromString("true"); + /** + * Creates a new instance of LimitCpuForMigration value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LimitCpuForMigration() { + } /** * Creates or finds a LimitCpuForMigration from its string representation. - * + * * @param name a name to look for. * @return the corresponding LimitCpuForMigration. */ @@ -29,7 +44,7 @@ public static LimitCpuForMigration fromString(String name) { /** * Gets known LimitCpuForMigration values. - * + * * @return known LimitCpuForMigration values. */ public static Collection values() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterfaces.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterface.java similarity index 77% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterfaces.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterface.java index e639639a348af..7c2556f59702d 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterfaces.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterface.java @@ -8,9 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Network Interface model. */ +/** + * Network Interface model. + */ @Fluent -public final class NetworkInterfaces { +public final class NetworkInterface { /* * Gets or sets the name of the network interface. */ @@ -18,21 +20,20 @@ public final class NetworkInterfaces { private String name; /* - * Gets the display name of the network interface as shown in the - * vmmServer. This is the fallback label for a NIC when the name is not - * set. + * Gets the display name of the network interface as shown in the vmmServer. This is the fallback label for a NIC + * when the name is not set. */ @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) private String displayName; /* - * Gets or sets the nic ipv4 addresses. + * Gets the nic ipv4 addresses. */ @JsonProperty(value = "ipv4Addresses", access = JsonProperty.Access.WRITE_ONLY) private List ipv4Addresses; /* - * Gets or sets the nic ipv6 addresses. + * Gets the nic ipv6 addresses. */ @JsonProperty(value = "ipv6Addresses", access = JsonProperty.Access.WRITE_ONLY) private List ipv6Addresses; @@ -44,15 +45,13 @@ public final class NetworkInterfaces { private String macAddress; /* - * Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource - * to connect the nic. + * Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to connect the nic. */ @JsonProperty(value = "virtualNetworkId") private String virtualNetworkId; /* - * Gets or sets the name of the virtual network in vmmServer that the nic - * is connected to. + * Gets the name of the virtual network in vmmServer that the nic is connected to. */ @JsonProperty(value = "networkName", access = JsonProperty.Access.WRITE_ONLY) private String networkName; @@ -81,9 +80,15 @@ public final class NetworkInterfaces { @JsonProperty(value = "nicId") private String nicId; + /** + * Creates an instance of NetworkInterface class. + */ + public NetworkInterface() { + } + /** * Get the name property: Gets or sets the name of the network interface. - * + * * @return the name value. */ public String name() { @@ -92,11 +97,11 @@ public String name() { /** * Set the name property: Gets or sets the name of the network interface. - * + * * @param name the name value to set. - * @return the NetworkInterfaces object itself. + * @return the NetworkInterface object itself. */ - public NetworkInterfaces withName(String name) { + public NetworkInterface withName(String name) { this.name = name; return this; } @@ -104,7 +109,7 @@ public NetworkInterfaces withName(String name) { /** * Get the displayName property: Gets the display name of the network interface as shown in the vmmServer. This is * the fallback label for a NIC when the name is not set. - * + * * @return the displayName value. */ public String displayName() { @@ -112,8 +117,8 @@ public String displayName() { } /** - * Get the ipv4Addresses property: Gets or sets the nic ipv4 addresses. - * + * Get the ipv4Addresses property: Gets the nic ipv4 addresses. + * * @return the ipv4Addresses value. */ public List ipv4Addresses() { @@ -121,8 +126,8 @@ public List ipv4Addresses() { } /** - * Get the ipv6Addresses property: Gets or sets the nic ipv6 addresses. - * + * Get the ipv6Addresses property: Gets the nic ipv6 addresses. + * * @return the ipv6Addresses value. */ public List ipv6Addresses() { @@ -131,7 +136,7 @@ public List ipv6Addresses() { /** * Get the macAddress property: Gets or sets the nic MAC address. - * + * * @return the macAddress value. */ public String macAddress() { @@ -140,11 +145,11 @@ public String macAddress() { /** * Set the macAddress property: Gets or sets the nic MAC address. - * + * * @param macAddress the macAddress value to set. - * @return the NetworkInterfaces object itself. + * @return the NetworkInterface object itself. */ - public NetworkInterfaces withMacAddress(String macAddress) { + public NetworkInterface withMacAddress(String macAddress) { this.macAddress = macAddress; return this; } @@ -152,7 +157,7 @@ public NetworkInterfaces withMacAddress(String macAddress) { /** * Get the virtualNetworkId property: Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to * connect the nic. - * + * * @return the virtualNetworkId value. */ public String virtualNetworkId() { @@ -162,19 +167,18 @@ public String virtualNetworkId() { /** * Set the virtualNetworkId property: Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to * connect the nic. - * + * * @param virtualNetworkId the virtualNetworkId value to set. - * @return the NetworkInterfaces object itself. + * @return the NetworkInterface object itself. */ - public NetworkInterfaces withVirtualNetworkId(String virtualNetworkId) { + public NetworkInterface withVirtualNetworkId(String virtualNetworkId) { this.virtualNetworkId = virtualNetworkId; return this; } /** - * Get the networkName property: Gets or sets the name of the virtual network in vmmServer that the nic is connected - * to. - * + * Get the networkName property: Gets the name of the virtual network in vmmServer that the nic is connected to. + * * @return the networkName value. */ public String networkName() { @@ -183,7 +187,7 @@ public String networkName() { /** * Get the ipv4AddressType property: Gets or sets the ipv4 address type. - * + * * @return the ipv4AddressType value. */ public AllocationMethod ipv4AddressType() { @@ -192,18 +196,18 @@ public AllocationMethod ipv4AddressType() { /** * Set the ipv4AddressType property: Gets or sets the ipv4 address type. - * + * * @param ipv4AddressType the ipv4AddressType value to set. - * @return the NetworkInterfaces object itself. + * @return the NetworkInterface object itself. */ - public NetworkInterfaces withIpv4AddressType(AllocationMethod ipv4AddressType) { + public NetworkInterface withIpv4AddressType(AllocationMethod ipv4AddressType) { this.ipv4AddressType = ipv4AddressType; return this; } /** * Get the ipv6AddressType property: Gets or sets the ipv6 address type. - * + * * @return the ipv6AddressType value. */ public AllocationMethod ipv6AddressType() { @@ -212,18 +216,18 @@ public AllocationMethod ipv6AddressType() { /** * Set the ipv6AddressType property: Gets or sets the ipv6 address type. - * + * * @param ipv6AddressType the ipv6AddressType value to set. - * @return the NetworkInterfaces object itself. + * @return the NetworkInterface object itself. */ - public NetworkInterfaces withIpv6AddressType(AllocationMethod ipv6AddressType) { + public NetworkInterface withIpv6AddressType(AllocationMethod ipv6AddressType) { this.ipv6AddressType = ipv6AddressType; return this; } /** * Get the macAddressType property: Gets or sets the mac address type. - * + * * @return the macAddressType value. */ public AllocationMethod macAddressType() { @@ -232,18 +236,18 @@ public AllocationMethod macAddressType() { /** * Set the macAddressType property: Gets or sets the mac address type. - * + * * @param macAddressType the macAddressType value to set. - * @return the NetworkInterfaces object itself. + * @return the NetworkInterface object itself. */ - public NetworkInterfaces withMacAddressType(AllocationMethod macAddressType) { + public NetworkInterface withMacAddressType(AllocationMethod macAddressType) { this.macAddressType = macAddressType; return this; } /** * Get the nicId property: Gets or sets the nic id. - * + * * @return the nicId value. */ public String nicId() { @@ -252,18 +256,18 @@ public String nicId() { /** * Set the nicId property: Gets or sets the nic id. - * + * * @param nicId the nicId value to set. - * @return the NetworkInterfaces object itself. + * @return the NetworkInterface object itself. */ - public NetworkInterfaces withNicId(String nicId) { + public NetworkInterface withNicId(String nicId) { this.nicId = nicId; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterfacesUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterfacesUpdate.java deleted file mode 100644 index 9da8cd4119ca2..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkInterfacesUpdate.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Network Interface model. */ -@Fluent -public final class NetworkInterfacesUpdate { - /* - * Gets or sets the name of the network interface. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Gets or sets the nic MAC address. - */ - @JsonProperty(value = "macAddress") - private String macAddress; - - /* - * Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource - * to connect the nic. - */ - @JsonProperty(value = "virtualNetworkId") - private String virtualNetworkId; - - /* - * Gets or sets the ipv4 address type. - */ - @JsonProperty(value = "ipv4AddressType") - private AllocationMethod ipv4AddressType; - - /* - * Gets or sets the ipv6 address type. - */ - @JsonProperty(value = "ipv6AddressType") - private AllocationMethod ipv6AddressType; - - /* - * Gets or sets the mac address type. - */ - @JsonProperty(value = "macAddressType") - private AllocationMethod macAddressType; - - /* - * Gets or sets the nic id. - */ - @JsonProperty(value = "nicId") - private String nicId; - - /** - * Get the name property: Gets or sets the name of the network interface. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets or sets the name of the network interface. - * - * @param name the name value to set. - * @return the NetworkInterfacesUpdate object itself. - */ - public NetworkInterfacesUpdate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the macAddress property: Gets or sets the nic MAC address. - * - * @return the macAddress value. - */ - public String macAddress() { - return this.macAddress; - } - - /** - * Set the macAddress property: Gets or sets the nic MAC address. - * - * @param macAddress the macAddress value to set. - * @return the NetworkInterfacesUpdate object itself. - */ - public NetworkInterfacesUpdate withMacAddress(String macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * Get the virtualNetworkId property: Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to - * connect the nic. - * - * @return the virtualNetworkId value. - */ - public String virtualNetworkId() { - return this.virtualNetworkId; - } - - /** - * Set the virtualNetworkId property: Gets or sets the ARM Id of the Microsoft.ScVmm/virtualNetwork resource to - * connect the nic. - * - * @param virtualNetworkId the virtualNetworkId value to set. - * @return the NetworkInterfacesUpdate object itself. - */ - public NetworkInterfacesUpdate withVirtualNetworkId(String virtualNetworkId) { - this.virtualNetworkId = virtualNetworkId; - return this; - } - - /** - * Get the ipv4AddressType property: Gets or sets the ipv4 address type. - * - * @return the ipv4AddressType value. - */ - public AllocationMethod ipv4AddressType() { - return this.ipv4AddressType; - } - - /** - * Set the ipv4AddressType property: Gets or sets the ipv4 address type. - * - * @param ipv4AddressType the ipv4AddressType value to set. - * @return the NetworkInterfacesUpdate object itself. - */ - public NetworkInterfacesUpdate withIpv4AddressType(AllocationMethod ipv4AddressType) { - this.ipv4AddressType = ipv4AddressType; - return this; - } - - /** - * Get the ipv6AddressType property: Gets or sets the ipv6 address type. - * - * @return the ipv6AddressType value. - */ - public AllocationMethod ipv6AddressType() { - return this.ipv6AddressType; - } - - /** - * Set the ipv6AddressType property: Gets or sets the ipv6 address type. - * - * @param ipv6AddressType the ipv6AddressType value to set. - * @return the NetworkInterfacesUpdate object itself. - */ - public NetworkInterfacesUpdate withIpv6AddressType(AllocationMethod ipv6AddressType) { - this.ipv6AddressType = ipv6AddressType; - return this; - } - - /** - * Get the macAddressType property: Gets or sets the mac address type. - * - * @return the macAddressType value. - */ - public AllocationMethod macAddressType() { - return this.macAddressType; - } - - /** - * Set the macAddressType property: Gets or sets the mac address type. - * - * @param macAddressType the macAddressType value to set. - * @return the NetworkInterfacesUpdate object itself. - */ - public NetworkInterfacesUpdate withMacAddressType(AllocationMethod macAddressType) { - this.macAddressType = macAddressType; - return this; - } - - /** - * Get the nicId property: Gets or sets the nic id. - * - * @return the nicId value. - */ - public String nicId() { - return this.nicId; - } - - /** - * Set the nicId property: Gets or sets the nic id. - * - * @param nicId the nicId value to set. - * @return the NetworkInterfacesUpdate object itself. - */ - public NetworkInterfacesUpdate withNicId(String nicId) { - this.nicId = nicId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkProfile.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkProfile.java index 236835c6891cc..df0859f4c39d8 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkProfile.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkProfile.java @@ -8,41 +8,48 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class NetworkProfile { /* - * Gets or sets the list of network interfaces associated with the virtual - * machine. + * Gets or sets the list of network interfaces associated with the virtual machine. */ @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; + private List networkInterfaces; + + /** + * Creates an instance of NetworkProfile class. + */ + public NetworkProfile() { + } /** * Get the networkInterfaces property: Gets or sets the list of network interfaces associated with the virtual * machine. - * + * * @return the networkInterfaces value. */ - public List networkInterfaces() { + public List networkInterfaces() { return this.networkInterfaces; } /** * Set the networkInterfaces property: Gets or sets the list of network interfaces associated with the virtual * machine. - * + * * @param networkInterfaces the networkInterfaces value to set. * @return the NetworkProfile object itself. */ - public NetworkProfile withNetworkInterfaces(List networkInterfaces) { + public NetworkProfile withNetworkInterfaces(List networkInterfaces) { this.networkInterfaces = networkInterfaces; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkProfileUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkProfileUpdate.java deleted file mode 100644 index a2f94cf4c0047..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/NetworkProfileUpdate.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.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Defines the resource properties. */ -@Fluent -public final class NetworkProfileUpdate { - /* - * Gets or sets the list of network interfaces associated with the virtual - * machine. - */ - @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; - - /** - * Get the networkInterfaces property: Gets or sets the list of network interfaces associated with the virtual - * machine. - * - * @return the networkInterfaces value. - */ - public List networkInterfaces() { - return this.networkInterfaces; - } - - /** - * Set the networkInterfaces property: Gets or sets the list of network interfaces associated with the virtual - * machine. - * - * @param networkInterfaces the networkInterfaces value to set. - * @return the NetworkProfileUpdate object itself. - */ - public NetworkProfileUpdate withNetworkInterfaces(List networkInterfaces) { - this.networkInterfaces = networkInterfaces; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (networkInterfaces() != null) { - networkInterfaces().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Operation.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Operation.java new file mode 100644 index 0000000000000..0f7143c2f090e --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.resourcemanager.scvmm.fluent.models.OperationInner; + +/** + * 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(); + + /** + * 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(); + + /** + * 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(); + + /** + * 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.scvmm.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OperationDisplay.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OperationDisplay.java new file mode 100644 index 0000000000000..0954072e62f11 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OperationDisplay.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay { + /* + * 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". + */ + @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". + */ + @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. + */ + 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() { + return this.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() { + return this.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() { + return this.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() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OperationListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OperationListResult.java new file mode 100644 index 0000000000000..36200eb5acf7f --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OperationListResult.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.scvmm.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set + * of results. + */ +@Immutable +public final class OperationListResult { + /* + * 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. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.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() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Operations.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Operations.java index a816f92d5bf00..caf6db84f41fb 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Operations.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Operations.java @@ -7,25 +7,29 @@ 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 { /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return results of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Returns list of all operations. - * + * List the operations for the provider. + * * @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 results of the request to list operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Origin.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Origin.java new file mode 100644 index 0000000000000..8670797d984ba --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/Origin.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * 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 + 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() { + return values(Origin.class); + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsProfile.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsProfileForVmInstance.java similarity index 60% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsProfile.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsProfileForVmInstance.java index 3a78b8a4ce2db..98e57a3d4c1de 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsProfile.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsProfileForVmInstance.java @@ -7,9 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent -public final class OsProfile { +public final class OsProfileForVmInstance { /* * Admin password of the virtual machine. */ @@ -23,20 +25,32 @@ public final class OsProfile { private String computerName; /* - * Gets or sets the type of the os. + * Gets the type of the os. */ @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) private OsType osType; /* - * Gets or sets os name. + * Gets os sku. */ - @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) - private String osName; + @JsonProperty(value = "osSku", access = JsonProperty.Access.WRITE_ONLY) + private String osSku; + + /* + * Gets os version. + */ + @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osVersion; + + /** + * Creates an instance of OsProfileForVmInstance class. + */ + public OsProfileForVmInstance() { + } /** * Get the adminPassword property: Admin password of the virtual machine. - * + * * @return the adminPassword value. */ public String adminPassword() { @@ -45,18 +59,18 @@ public String adminPassword() { /** * Set the adminPassword property: Admin password of the virtual machine. - * + * * @param adminPassword the adminPassword value to set. - * @return the OsProfile object itself. + * @return the OsProfileForVmInstance object itself. */ - public OsProfile withAdminPassword(String adminPassword) { + public OsProfileForVmInstance withAdminPassword(String adminPassword) { this.adminPassword = adminPassword; return this; } /** * Get the computerName property: Gets or sets computer name. - * + * * @return the computerName value. */ public String computerName() { @@ -65,18 +79,18 @@ public String computerName() { /** * Set the computerName property: Gets or sets computer name. - * + * * @param computerName the computerName value to set. - * @return the OsProfile object itself. + * @return the OsProfileForVmInstance object itself. */ - public OsProfile withComputerName(String computerName) { + public OsProfileForVmInstance withComputerName(String computerName) { this.computerName = computerName; return this; } /** - * Get the osType property: Gets or sets the type of the os. - * + * Get the osType property: Gets the type of the os. + * * @return the osType value. */ public OsType osType() { @@ -84,17 +98,26 @@ public OsType osType() { } /** - * Get the osName property: Gets or sets os name. - * - * @return the osName value. + * Get the osSku property: Gets os sku. + * + * @return the osSku value. + */ + public String osSku() { + return this.osSku; + } + + /** + * Get the osVersion property: Gets os version. + * + * @return the osVersion value. */ - public String osName() { - return this.osName; + public String osVersion() { + return this.osVersion; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsType.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsType.java index f446a8024488d..aa00ffb35eb5a 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsType.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/OsType.java @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for OsType. */ +/** + * Virtual machine operating system type. + */ public final class OsType extends ExpandableStringEnum { - /** Static value Windows for OsType. */ + /** + * Static value Windows for OsType. + */ public static final OsType WINDOWS = fromString("Windows"); - /** Static value Linux for OsType. */ + /** + * Static value Linux for OsType. + */ public static final OsType LINUX = fromString("Linux"); - /** Static value Other for OsType. */ + /** + * Static value Other for OsType. + */ public static final OsType OTHER = fromString("Other"); + /** + * Creates a new instance of OsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OsType() { + } + /** * Creates or finds a OsType from its string representation. - * + * * @param name a name to look for. * @return the corresponding OsType. */ @@ -32,7 +49,7 @@ public static OsType fromString(String name) { /** * Gets known OsType values. - * + * * @return known OsType values. */ public static Collection values() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ProvisioningAction.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ProvisioningAction.java new file mode 100644 index 0000000000000..2f92750b5e7ba --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ProvisioningAction.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Guest agent provisioning action. + */ +public final class ProvisioningAction extends ExpandableStringEnum { + /** + * Static value install for ProvisioningAction. + */ + public static final ProvisioningAction INSTALL = fromString("install"); + + /** + * Static value uninstall for ProvisioningAction. + */ + public static final ProvisioningAction UNINSTALL = fromString("uninstall"); + + /** + * Static value repair for ProvisioningAction. + */ + public static final ProvisioningAction REPAIR = fromString("repair"); + + /** + * Creates a new instance of ProvisioningAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningAction() { + } + + /** + * Creates or finds a ProvisioningAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningAction. + */ + @JsonCreator + public static ProvisioningAction fromString(String name) { + return fromString(name, ProvisioningAction.class); + } + + /** + * Gets known ProvisioningAction values. + * + * @return known ProvisioningAction values. + */ + public static Collection values() { + return values(ProvisioningAction.class); + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ProvisioningState.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ProvisioningState.java new file mode 100644 index 0000000000000..7e4ae4380ca2c --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ProvisioningState.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The provisioning state of the resource. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Provisioning for ProvisioningState. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Accepted for ProvisioningState. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Created for ProvisioningState. + */ + public static final ProvisioningState CREATED = fromString("Created"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperation.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperation.java deleted file mode 100644 index fc49ed8d26042..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperation.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.scvmm.models; - -import com.azure.resourcemanager.scvmm.fluent.models.ResourceProviderOperationInner; - -/** An immutable client-side representation of ResourceProviderOperation. */ -public interface ResourceProviderOperation { - /** - * Gets the isDataAction property: Indicates whether the operation applies to data-plane. - * - * @return the isDataAction value. - */ - String isDataAction(); - - /** - * Gets the name property: Operation name, in format of {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: Display metadata associated with the operation. - * - * @return the display value. - */ - ResourceProviderOperationDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.scvmm.fluent.models.ResourceProviderOperationInner object. - * - * @return the inner object. - */ - ResourceProviderOperationInner innerModel(); -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperationDisplay.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperationDisplay.java deleted file mode 100644 index 92afd01048fde..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperationDisplay.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display metadata associated with the operation. */ -@Fluent -public final class ResourceProviderOperationDisplay { - /* - * The resource provider. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Type of operation: read, write, delete, etc. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Description of this operation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: The resource provider. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: The resource provider. - * - * @param provider the provider value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed. - * - * @param resource the resource value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Type of operation: read, write, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Type of operation: read, write, delete, etc. - * - * @param operation the operation value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of this operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of this operation. - * - * @param description the description value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperationList.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperationList.java deleted file mode 100644 index 3b302688fa4da..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/ResourceProviderOperationList.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.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.scvmm.fluent.models.ResourceProviderOperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Results of the request to list operations. */ -@Fluent -public final class ResourceProviderOperationList { - /* - * List of Operations. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Url to follow for getting next page of resources. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of Operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Operations. - * - * @param value the value value to set. - * @return the ResourceProviderOperationList object itself. - */ - public ResourceProviderOperationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Url to follow for getting next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Url to follow for getting next page of resources. - * - * @param nextLink the nextLink value to set. - * @return the ResourceProviderOperationList object itself. - */ - public ResourceProviderOperationList withNextLink(String nextLink) { - this.nextLink = nextLink; - 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()); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/SkipShutdown.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/SkipShutdown.java new file mode 100644 index 0000000000000..babb4adfe36e7 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/SkipShutdown.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.scvmm.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Skip shutdown. + */ +public final class SkipShutdown extends ExpandableStringEnum { + /** + * Static value true for SkipShutdown. + */ + public static final SkipShutdown TRUE = fromString("true"); + + /** + * 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 + 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() { + return values(SkipShutdown.class); + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StopVirtualMachineOptions.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StopVirtualMachineOptions.java index affdcb88ece27..f6163f6d17e32 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StopVirtualMachineOptions.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StopVirtualMachineOptions.java @@ -7,42 +7,49 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the stop action properties. */ +/** + * Defines the stop action properties. + */ @Fluent public final class StopVirtualMachineOptions { /* - * Gets or sets a value indicating whether to request non-graceful VM - * shutdown. True value for this flag indicates non-graceful shutdown - * whereas false indicates otherwise. Defaults to false. + * Gets or sets a value indicating whether to request non-graceful VM shutdown. True value for this flag indicates + * non-graceful shutdown whereas false indicates otherwise. Defaults to false. */ @JsonProperty(value = "skipShutdown") - private Boolean skipShutdown; + private SkipShutdown skipShutdown; + + /** + * Creates an instance of StopVirtualMachineOptions class. + */ + public StopVirtualMachineOptions() { + } /** * Get the skipShutdown property: Gets or sets a value indicating whether to request non-graceful VM shutdown. True * value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Defaults to false. - * + * * @return the skipShutdown value. */ - public Boolean skipShutdown() { + public SkipShutdown skipShutdown() { return this.skipShutdown; } /** * Set the skipShutdown property: Gets or sets a value indicating whether to request non-graceful VM shutdown. True * value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Defaults to false. - * + * * @param skipShutdown the skipShutdown value to set. * @return the StopVirtualMachineOptions object itself. */ - public StopVirtualMachineOptions withSkipShutdown(Boolean skipShutdown) { + public StopVirtualMachineOptions withSkipShutdown(SkipShutdown skipShutdown) { this.skipShutdown = skipShutdown; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageProfile.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageProfile.java index 45a8e7d358932..85fc981c18c5c 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageProfile.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageProfile.java @@ -8,19 +8,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class StorageProfile { /* - * Gets or sets the list of virtual disks associated with the virtual - * machine. + * Gets or sets the list of virtual disks associated with the virtual machine. */ @JsonProperty(value = "disks") private List disks; + /** + * Creates an instance of StorageProfile class. + */ + public StorageProfile() { + } + /** * Get the disks property: Gets or sets the list of virtual disks associated with the virtual machine. - * + * * @return the disks value. */ public List disks() { @@ -29,7 +36,7 @@ public List disks() { /** * Set the disks property: Gets or sets the list of virtual disks associated with the virtual machine. - * + * * @param disks the disks value to set. * @return the StorageProfile object itself. */ @@ -40,7 +47,7 @@ public StorageProfile withDisks(List disks) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageProfileUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageProfileUpdate.java deleted file mode 100644 index eff10b598a633..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageProfileUpdate.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.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Defines the resource properties. */ -@Fluent -public final class StorageProfileUpdate { - /* - * Gets or sets the list of virtual disks associated with the virtual - * machine. - */ - @JsonProperty(value = "disks") - private List disks; - - /** - * Get the disks property: Gets or sets the list of virtual disks associated with the virtual machine. - * - * @return the disks value. - */ - public List disks() { - return this.disks; - } - - /** - * Set the disks property: Gets or sets the list of virtual disks associated with the virtual machine. - * - * @param disks the disks value to set. - * @return the StorageProfileUpdate object itself. - */ - public StorageProfileUpdate withDisks(List disks) { - this.disks = disks; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (disks() != null) { - disks().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQoSPolicy.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQosPolicy.java similarity index 73% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQoSPolicy.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQosPolicy.java index 8c7d571f6e8a2..2626e3838cd4a 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQoSPolicy.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQosPolicy.java @@ -7,9 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The StorageQoSPolicy definition. */ +/** + * The StorageQoSPolicy definition. + */ @Fluent -public final class StorageQoSPolicy { +public final class StorageQosPolicy { /* * The name of the policy. */ @@ -26,19 +28,19 @@ public final class StorageQoSPolicy { * The maximum IO operations per second. */ @JsonProperty(value = "iopsMaximum") - private Long iopsMaximum; + private Integer iopsMaximum; /* * The minimum IO operations per second. */ @JsonProperty(value = "iopsMinimum") - private Long iopsMinimum; + private Integer iopsMinimum; /* * The Bandwidth Limit for internet traffic. */ @JsonProperty(value = "bandwidthLimit") - private Long bandwidthLimit; + private Integer bandwidthLimit; /* * The underlying policy. @@ -46,9 +48,15 @@ public final class StorageQoSPolicy { @JsonProperty(value = "policyId") private String policyId; + /** + * Creates an instance of StorageQosPolicy class. + */ + public StorageQosPolicy() { + } + /** * Get the name property: The name of the policy. - * + * * @return the name value. */ public String name() { @@ -57,18 +65,18 @@ public String name() { /** * Set the name property: The name of the policy. - * + * * @param name the name value to set. - * @return the StorageQoSPolicy object itself. + * @return the StorageQosPolicy object itself. */ - public StorageQoSPolicy withName(String name) { + public StorageQosPolicy withName(String name) { this.name = name; return this; } /** * Get the id property: The ID of the QoS policy. - * + * * @return the id value. */ public String id() { @@ -77,78 +85,78 @@ public String id() { /** * Set the id property: The ID of the QoS policy. - * + * * @param id the id value to set. - * @return the StorageQoSPolicy object itself. + * @return the StorageQosPolicy object itself. */ - public StorageQoSPolicy withId(String id) { + public StorageQosPolicy withId(String id) { this.id = id; return this; } /** * Get the iopsMaximum property: The maximum IO operations per second. - * + * * @return the iopsMaximum value. */ - public Long iopsMaximum() { + public Integer iopsMaximum() { return this.iopsMaximum; } /** * Set the iopsMaximum property: The maximum IO operations per second. - * + * * @param iopsMaximum the iopsMaximum value to set. - * @return the StorageQoSPolicy object itself. + * @return the StorageQosPolicy object itself. */ - public StorageQoSPolicy withIopsMaximum(Long iopsMaximum) { + public StorageQosPolicy withIopsMaximum(Integer iopsMaximum) { this.iopsMaximum = iopsMaximum; return this; } /** * Get the iopsMinimum property: The minimum IO operations per second. - * + * * @return the iopsMinimum value. */ - public Long iopsMinimum() { + public Integer iopsMinimum() { return this.iopsMinimum; } /** * Set the iopsMinimum property: The minimum IO operations per second. - * + * * @param iopsMinimum the iopsMinimum value to set. - * @return the StorageQoSPolicy object itself. + * @return the StorageQosPolicy object itself. */ - public StorageQoSPolicy withIopsMinimum(Long iopsMinimum) { + public StorageQosPolicy withIopsMinimum(Integer iopsMinimum) { this.iopsMinimum = iopsMinimum; return this; } /** * Get the bandwidthLimit property: The Bandwidth Limit for internet traffic. - * + * * @return the bandwidthLimit value. */ - public Long bandwidthLimit() { + public Integer bandwidthLimit() { return this.bandwidthLimit; } /** * Set the bandwidthLimit property: The Bandwidth Limit for internet traffic. - * + * * @param bandwidthLimit the bandwidthLimit value to set. - * @return the StorageQoSPolicy object itself. + * @return the StorageQosPolicy object itself. */ - public StorageQoSPolicy withBandwidthLimit(Long bandwidthLimit) { + public StorageQosPolicy withBandwidthLimit(Integer bandwidthLimit) { this.bandwidthLimit = bandwidthLimit; return this; } /** * Get the policyId property: The underlying policy. - * + * * @return the policyId value. */ public String policyId() { @@ -157,18 +165,18 @@ public String policyId() { /** * Set the policyId property: The underlying policy. - * + * * @param policyId the policyId value to set. - * @return the StorageQoSPolicy object itself. + * @return the StorageQosPolicy object itself. */ - public StorageQoSPolicy withPolicyId(String policyId) { + public StorageQosPolicy withPolicyId(String policyId) { this.policyId = policyId; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQoSPolicyDetails.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQosPolicyDetails.java similarity index 72% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQoSPolicyDetails.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQosPolicyDetails.java index d7c9c264620e0..200ecdff25842 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQoSPolicyDetails.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/StorageQosPolicyDetails.java @@ -7,9 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The StorageQoSPolicyDetails definition. */ +/** + * The StorageQoSPolicyDetails definition. + */ @Fluent -public final class StorageQoSPolicyDetails { +public final class StorageQosPolicyDetails { /* * The name of the policy. */ @@ -22,9 +24,15 @@ public final class StorageQoSPolicyDetails { @JsonProperty(value = "id") private String id; + /** + * Creates an instance of StorageQosPolicyDetails class. + */ + public StorageQosPolicyDetails() { + } + /** * Get the name property: The name of the policy. - * + * * @return the name value. */ public String name() { @@ -33,18 +41,18 @@ public String name() { /** * Set the name property: The name of the policy. - * + * * @param name the name value to set. - * @return the StorageQoSPolicyDetails object itself. + * @return the StorageQosPolicyDetails object itself. */ - public StorageQoSPolicyDetails withName(String name) { + public StorageQosPolicyDetails withName(String name) { this.name = name; return this; } /** * Get the id property: The ID of the QoS policy. - * + * * @return the id value. */ public String id() { @@ -53,18 +61,18 @@ public String id() { /** * Set the id property: The ID of the QoS policy. - * + * * @param id the id value to set. - * @return the StorageQoSPolicyDetails object itself. + * @return the StorageQosPolicyDetails object itself. */ - public StorageQoSPolicyDetails withId(String id) { + public StorageQosPolicyDetails withId(String id) { this.id = id; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualDisk.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualDisk.java index afc87f05ca68c..4f71631b6a168 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualDisk.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualDisk.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Virtual disk model. */ +/** + * Virtual disk model. + */ @Fluent public final class VirtualDisk { /* @@ -17,8 +19,8 @@ public final class VirtualDisk { private String name; /* - * Gets the display name of the virtual disk as shown in the vmmServer. - * This is the fallback label for a disk when the name is not set. + * Gets the display name of the virtual disk as shown in the vmmServer. This is the fallback label for a disk when + * the name is not set. */ @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) private String displayName; @@ -36,7 +38,7 @@ public final class VirtualDisk { private Integer diskSizeGB; /* - * Gets or sets the max disk size. + * Gets the max disk size. */ @JsonProperty(value = "maxDiskSizeGB", access = JsonProperty.Access.WRITE_ONLY) private Integer maxDiskSizeGB; @@ -66,7 +68,7 @@ public final class VirtualDisk { private String vhdType; /* - * Gets or sets the disk volume type. + * Gets the disk volume type. */ @JsonProperty(value = "volumeType", access = JsonProperty.Access.WRITE_ONLY) private String volumeType; @@ -87,7 +89,7 @@ public final class VirtualDisk { * The QoS policy for the disk. */ @JsonProperty(value = "storageQoSPolicy") - private StorageQoSPolicyDetails storageQoSPolicy; + private StorageQosPolicyDetails storageQosPolicy; /* * Gets or sets a value indicating diff disk. @@ -95,9 +97,15 @@ public final class VirtualDisk { @JsonProperty(value = "createDiffDisk") private CreateDiffDisk createDiffDisk; + /** + * Creates an instance of VirtualDisk class. + */ + public VirtualDisk() { + } + /** * Get the name property: Gets or sets the name of the disk. - * + * * @return the name value. */ public String name() { @@ -106,7 +114,7 @@ public String name() { /** * Set the name property: Gets or sets the name of the disk. - * + * * @param name the name value to set. * @return the VirtualDisk object itself. */ @@ -118,7 +126,7 @@ public VirtualDisk withName(String name) { /** * Get the displayName property: Gets the display name of the virtual disk as shown in the vmmServer. This is the * fallback label for a disk when the name is not set. - * + * * @return the displayName value. */ public String displayName() { @@ -127,7 +135,7 @@ public String displayName() { /** * Get the diskId property: Gets or sets the disk id. - * + * * @return the diskId value. */ public String diskId() { @@ -136,7 +144,7 @@ public String diskId() { /** * Set the diskId property: Gets or sets the disk id. - * + * * @param diskId the diskId value to set. * @return the VirtualDisk object itself. */ @@ -147,7 +155,7 @@ public VirtualDisk withDiskId(String diskId) { /** * Get the diskSizeGB property: Gets or sets the disk total size. - * + * * @return the diskSizeGB value. */ public Integer diskSizeGB() { @@ -156,7 +164,7 @@ public Integer diskSizeGB() { /** * Set the diskSizeGB property: Gets or sets the disk total size. - * + * * @param diskSizeGB the diskSizeGB value to set. * @return the VirtualDisk object itself. */ @@ -166,8 +174,8 @@ public VirtualDisk withDiskSizeGB(Integer diskSizeGB) { } /** - * Get the maxDiskSizeGB property: Gets or sets the max disk size. - * + * Get the maxDiskSizeGB property: Gets the max disk size. + * * @return the maxDiskSizeGB value. */ public Integer maxDiskSizeGB() { @@ -176,7 +184,7 @@ public Integer maxDiskSizeGB() { /** * Get the bus property: Gets or sets the disk bus. - * + * * @return the bus value. */ public Integer bus() { @@ -185,7 +193,7 @@ public Integer bus() { /** * Set the bus property: Gets or sets the disk bus. - * + * * @param bus the bus value to set. * @return the VirtualDisk object itself. */ @@ -196,7 +204,7 @@ public VirtualDisk withBus(Integer bus) { /** * Get the lun property: Gets or sets the disk lun. - * + * * @return the lun value. */ public Integer lun() { @@ -205,7 +213,7 @@ public Integer lun() { /** * Set the lun property: Gets or sets the disk lun. - * + * * @param lun the lun value to set. * @return the VirtualDisk object itself. */ @@ -216,7 +224,7 @@ public VirtualDisk withLun(Integer lun) { /** * Get the busType property: Gets or sets the disk bus type. - * + * * @return the busType value. */ public String busType() { @@ -225,7 +233,7 @@ public String busType() { /** * Set the busType property: Gets or sets the disk bus type. - * + * * @param busType the busType value to set. * @return the VirtualDisk object itself. */ @@ -236,7 +244,7 @@ public VirtualDisk withBusType(String busType) { /** * Get the vhdType property: Gets or sets the disk vhd type. - * + * * @return the vhdType value. */ public String vhdType() { @@ -245,7 +253,7 @@ public String vhdType() { /** * Set the vhdType property: Gets or sets the disk vhd type. - * + * * @param vhdType the vhdType value to set. * @return the VirtualDisk object itself. */ @@ -255,8 +263,8 @@ public VirtualDisk withVhdType(String vhdType) { } /** - * Get the volumeType property: Gets or sets the disk volume type. - * + * Get the volumeType property: Gets the disk volume type. + * * @return the volumeType value. */ public String volumeType() { @@ -265,7 +273,7 @@ public String volumeType() { /** * Get the vhdFormatType property: Gets the disk vhd format type. - * + * * @return the vhdFormatType value. */ public String vhdFormatType() { @@ -274,7 +282,7 @@ public String vhdFormatType() { /** * Get the templateDiskId property: Gets or sets the disk id in the template. - * + * * @return the templateDiskId value. */ public String templateDiskId() { @@ -283,7 +291,7 @@ public String templateDiskId() { /** * Set the templateDiskId property: Gets or sets the disk id in the template. - * + * * @param templateDiskId the templateDiskId value to set. * @return the VirtualDisk object itself. */ @@ -293,28 +301,28 @@ public VirtualDisk withTemplateDiskId(String templateDiskId) { } /** - * Get the storageQoSPolicy property: The QoS policy for the disk. - * - * @return the storageQoSPolicy value. + * Get the storageQosPolicy property: The QoS policy for the disk. + * + * @return the storageQosPolicy value. */ - public StorageQoSPolicyDetails storageQoSPolicy() { - return this.storageQoSPolicy; + public StorageQosPolicyDetails storageQosPolicy() { + return this.storageQosPolicy; } /** - * Set the storageQoSPolicy property: The QoS policy for the disk. - * - * @param storageQoSPolicy the storageQoSPolicy value to set. + * Set the storageQosPolicy property: The QoS policy for the disk. + * + * @param storageQosPolicy the storageQosPolicy value to set. * @return the VirtualDisk object itself. */ - public VirtualDisk withStorageQoSPolicy(StorageQoSPolicyDetails storageQoSPolicy) { - this.storageQoSPolicy = storageQoSPolicy; + public VirtualDisk withStorageQosPolicy(StorageQosPolicyDetails storageQosPolicy) { + this.storageQosPolicy = storageQosPolicy; return this; } /** * Get the createDiffDisk property: Gets or sets a value indicating diff disk. - * + * * @return the createDiffDisk value. */ public CreateDiffDisk createDiffDisk() { @@ -323,7 +331,7 @@ public CreateDiffDisk createDiffDisk() { /** * Set the createDiffDisk property: Gets or sets a value indicating diff disk. - * + * * @param createDiffDisk the createDiffDisk value to set. * @return the VirtualDisk object itself. */ @@ -334,12 +342,12 @@ public VirtualDisk withCreateDiffDisk(CreateDiffDisk createDiffDisk) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (storageQoSPolicy() != null) { - storageQoSPolicy().validate(); + if (storageQosPolicy() != null) { + storageQosPolicy().validate(); } } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualDiskUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualDiskUpdate.java deleted file mode 100644 index 7fa03f42a269f..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualDiskUpdate.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Virtual disk model. */ -@Fluent -public final class VirtualDiskUpdate { - /* - * Gets or sets the name of the disk. - */ - @JsonProperty(value = "name") - private String name; - - /* - * Gets or sets the disk id. - */ - @JsonProperty(value = "diskId") - private String diskId; - - /* - * Gets or sets the disk total size. - */ - @JsonProperty(value = "diskSizeGB") - private Integer diskSizeGB; - - /* - * Gets or sets the disk bus. - */ - @JsonProperty(value = "bus") - private Integer bus; - - /* - * Gets or sets the disk lun. - */ - @JsonProperty(value = "lun") - private Integer lun; - - /* - * Gets or sets the disk bus type. - */ - @JsonProperty(value = "busType") - private String busType; - - /* - * Gets or sets the disk vhd type. - */ - @JsonProperty(value = "vhdType") - private String vhdType; - - /* - * The QoS policy for the disk. - */ - @JsonProperty(value = "storageQoSPolicy") - private StorageQoSPolicyDetails storageQoSPolicy; - - /** - * Get the name property: Gets or sets the name of the disk. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Gets or sets the name of the disk. - * - * @param name the name value to set. - * @return the VirtualDiskUpdate object itself. - */ - public VirtualDiskUpdate withName(String name) { - this.name = name; - return this; - } - - /** - * Get the diskId property: Gets or sets the disk id. - * - * @return the diskId value. - */ - public String diskId() { - return this.diskId; - } - - /** - * Set the diskId property: Gets or sets the disk id. - * - * @param diskId the diskId value to set. - * @return the VirtualDiskUpdate object itself. - */ - public VirtualDiskUpdate withDiskId(String diskId) { - this.diskId = diskId; - return this; - } - - /** - * Get the diskSizeGB property: Gets or sets the disk total size. - * - * @return the diskSizeGB value. - */ - public Integer diskSizeGB() { - return this.diskSizeGB; - } - - /** - * Set the diskSizeGB property: Gets or sets the disk total size. - * - * @param diskSizeGB the diskSizeGB value to set. - * @return the VirtualDiskUpdate object itself. - */ - public VirtualDiskUpdate withDiskSizeGB(Integer diskSizeGB) { - this.diskSizeGB = diskSizeGB; - return this; - } - - /** - * Get the bus property: Gets or sets the disk bus. - * - * @return the bus value. - */ - public Integer bus() { - return this.bus; - } - - /** - * Set the bus property: Gets or sets the disk bus. - * - * @param bus the bus value to set. - * @return the VirtualDiskUpdate object itself. - */ - public VirtualDiskUpdate withBus(Integer bus) { - this.bus = bus; - return this; - } - - /** - * Get the lun property: Gets or sets the disk lun. - * - * @return the lun value. - */ - public Integer lun() { - return this.lun; - } - - /** - * Set the lun property: Gets or sets the disk lun. - * - * @param lun the lun value to set. - * @return the VirtualDiskUpdate object itself. - */ - public VirtualDiskUpdate withLun(Integer lun) { - this.lun = lun; - return this; - } - - /** - * Get the busType property: Gets or sets the disk bus type. - * - * @return the busType value. - */ - public String busType() { - return this.busType; - } - - /** - * Set the busType property: Gets or sets the disk bus type. - * - * @param busType the busType value to set. - * @return the VirtualDiskUpdate object itself. - */ - public VirtualDiskUpdate withBusType(String busType) { - this.busType = busType; - return this; - } - - /** - * Get the vhdType property: Gets or sets the disk vhd type. - * - * @return the vhdType value. - */ - public String vhdType() { - return this.vhdType; - } - - /** - * Set the vhdType property: Gets or sets the disk vhd type. - * - * @param vhdType the vhdType value to set. - * @return the VirtualDiskUpdate object itself. - */ - public VirtualDiskUpdate withVhdType(String vhdType) { - this.vhdType = vhdType; - return this; - } - - /** - * Get the storageQoSPolicy property: The QoS policy for the disk. - * - * @return the storageQoSPolicy value. - */ - public StorageQoSPolicyDetails storageQoSPolicy() { - return this.storageQoSPolicy; - } - - /** - * Set the storageQoSPolicy property: The QoS policy for the disk. - * - * @param storageQoSPolicy the storageQoSPolicy value to set. - * @return the VirtualDiskUpdate object itself. - */ - public VirtualDiskUpdate withStorageQoSPolicy(StorageQoSPolicyDetails storageQoSPolicy) { - this.storageQoSPolicy = storageQoSPolicy; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (storageQoSPolicy() != null) { - storageQoSPolicy().validate(); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachine.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachine.java deleted file mode 100644 index 08cfcafeff06e..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachine.java +++ /dev/null @@ -1,648 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInner; -import java.util.List; -import java.util.Map; - -/** 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 systemData property: The system data. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the extendedLocation property: The extended location. - * - * @return the extendedLocation value. - */ - ExtendedLocation extendedLocation(); - - /** - * Gets the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - String inventoryItemId(); - - /** - * Gets the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - String vmmServerId(); - - /** - * Gets the cloudId property: ARM Id of the cloud resource to use for deploying the vm. - * - * @return the cloudId value. - */ - String cloudId(); - - /** - * Gets the templateId property: ARM Id of the template resource to use for deploying the vm. - * - * @return the templateId value. - */ - String templateId(); - - /** - * Gets the checkpointType property: Type of checkpoint supported for the vm. - * - * @return the checkpointType value. - */ - String checkpointType(); - - /** - * Gets the checkpoints property: Checkpoints in the vm. - * - * @return the checkpoints value. - */ - List checkpoints(); - - /** - * Gets the availabilitySets property: Availability Sets in vm. - * - * @return the availabilitySets value. - */ - List availabilitySets(); - - /** - * Gets the osProfile property: OS properties. - * - * @return the osProfile value. - */ - OsProfile osProfile(); - - /** - * Gets the hardwareProfile property: Hardware properties. - * - * @return the hardwareProfile value. - */ - HardwareProfile hardwareProfile(); - - /** - * Gets the networkProfile property: Network properties. - * - * @return the networkProfile value. - */ - NetworkProfile networkProfile(); - - /** - * Gets the storageProfile property: Storage properties. - * - * @return the storageProfile value. - */ - StorageProfile storageProfile(); - - /** - * Gets the vmName property: VMName is the name of VM on the SCVMM server. - * - * @return the vmName value. - */ - String vmName(); - - /** - * Gets the uuid property: Unique ID of the virtual machine. - * - * @return the uuid value. - */ - String uuid(); - - /** - * Gets the generation property: Gets or sets the generation for the vm. - * - * @return the generation value. - */ - Integer generation(); - - /** - * Gets the powerState property: Gets the power state of the virtual machine. - * - * @return the powerState value. - */ - String powerState(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. - */ - String 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 inner com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInner object. - * - * @return the inner object. - */ - VirtualMachineInner innerModel(); - - /** The entirety of the VirtualMachine definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithExtendedLocation, - DefinitionStages.WithCreate { - } - /** The VirtualMachine definition stages. */ - interface DefinitionStages { - /** The first stage of the VirtualMachine definition. */ - interface Blank extends WithLocation { - } - /** 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. - */ - WithResourceGroup withRegion(Region location); - - /** - * 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. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. - * @return the next definition stage. - */ - WithExtendedLocation withExistingResourceGroup(String resourceGroupName); - } - /** The stage of the VirtualMachine definition allowing to specify extendedLocation. */ - interface WithExtendedLocation { - /** - * Specifies the extendedLocation property: The extended location.. - * - * @param extendedLocation The extended location. - * @return the next definition stage. - */ - WithCreate withExtendedLocation(ExtendedLocation extendedLocation); - } - /** - * The stage of the VirtualMachine 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.WithInventoryItemId, - DefinitionStages.WithVmmServerId, - DefinitionStages.WithCloudId, - DefinitionStages.WithTemplateId, - DefinitionStages.WithCheckpointType, - DefinitionStages.WithCheckpoints, - DefinitionStages.WithAvailabilitySets, - DefinitionStages.WithOsProfile, - DefinitionStages.WithHardwareProfile, - DefinitionStages.WithNetworkProfile, - DefinitionStages.WithStorageProfile, - DefinitionStages.WithVmName, - DefinitionStages.WithUuid, - DefinitionStages.WithGeneration { - /** - * 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. */ - 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 inventoryItemId. */ - interface WithInventoryItemId { - /** - * Specifies the inventoryItemId property: Gets or sets the inventory Item ID for the resource.. - * - * @param inventoryItemId Gets or sets the inventory Item ID for the resource. - * @return the next definition stage. - */ - WithCreate withInventoryItemId(String inventoryItemId); - } - /** The stage of the VirtualMachine definition allowing to specify vmmServerId. */ - interface WithVmmServerId { - /** - * Specifies the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.. - * - * @param vmmServerId ARM Id of the vmmServer resource in which this resource resides. - * @return the next definition stage. - */ - WithCreate withVmmServerId(String vmmServerId); - } - /** The stage of the VirtualMachine definition allowing to specify cloudId. */ - interface WithCloudId { - /** - * Specifies the cloudId property: ARM Id of the cloud resource to use for deploying the vm.. - * - * @param cloudId ARM Id of the cloud resource to use for deploying the vm. - * @return the next definition stage. - */ - WithCreate withCloudId(String cloudId); - } - /** The stage of the VirtualMachine definition allowing to specify templateId. */ - interface WithTemplateId { - /** - * Specifies the templateId property: ARM Id of the template resource to use for deploying the vm.. - * - * @param templateId ARM Id of the template resource to use for deploying the vm. - * @return the next definition stage. - */ - WithCreate withTemplateId(String templateId); - } - /** The stage of the VirtualMachine definition allowing to specify checkpointType. */ - interface WithCheckpointType { - /** - * Specifies the checkpointType property: Type of checkpoint supported for the vm.. - * - * @param checkpointType Type of checkpoint supported for the vm. - * @return the next definition stage. - */ - WithCreate withCheckpointType(String checkpointType); - } - /** The stage of the VirtualMachine definition allowing to specify checkpoints. */ - interface WithCheckpoints { - /** - * Specifies the checkpoints property: Checkpoints in the vm.. - * - * @param checkpoints Checkpoints in the vm. - * @return the next definition stage. - */ - WithCreate withCheckpoints(List checkpoints); - } - /** The stage of the VirtualMachine definition allowing to specify availabilitySets. */ - interface WithAvailabilitySets { - /** - * Specifies the availabilitySets property: Availability Sets in vm.. - * - * @param availabilitySets Availability Sets in vm. - * @return the next definition stage. - */ - WithCreate withAvailabilitySets(List availabilitySets); - } - /** The stage of the VirtualMachine definition allowing to specify osProfile. */ - interface WithOsProfile { - /** - * Specifies the osProfile property: OS properties.. - * - * @param osProfile OS properties. - * @return the next definition stage. - */ - WithCreate withOsProfile(OsProfile osProfile); - } - /** The stage of the VirtualMachine definition allowing to specify hardwareProfile. */ - interface WithHardwareProfile { - /** - * Specifies the hardwareProfile property: Hardware properties.. - * - * @param hardwareProfile Hardware properties. - * @return the next definition stage. - */ - WithCreate withHardwareProfile(HardwareProfile hardwareProfile); - } - /** The stage of the VirtualMachine definition allowing to specify networkProfile. */ - interface WithNetworkProfile { - /** - * Specifies the networkProfile property: Network properties.. - * - * @param networkProfile Network properties. - * @return the next definition stage. - */ - WithCreate withNetworkProfile(NetworkProfile networkProfile); - } - /** The stage of the VirtualMachine definition allowing to specify storageProfile. */ - interface WithStorageProfile { - /** - * Specifies the storageProfile property: Storage properties.. - * - * @param storageProfile Storage properties. - * @return the next definition stage. - */ - WithCreate withStorageProfile(StorageProfile storageProfile); - } - /** The stage of the VirtualMachine definition allowing to specify vmName. */ - interface WithVmName { - /** - * Specifies the vmName property: VMName is the name of VM on the SCVMM server.. - * - * @param vmName VMName is the name of VM on the SCVMM server. - * @return the next definition stage. - */ - WithCreate withVmName(String vmName); - } - /** The stage of the VirtualMachine definition allowing to specify uuid. */ - interface WithUuid { - /** - * Specifies the uuid property: Unique ID of the virtual machine.. - * - * @param uuid Unique ID of the virtual machine. - * @return the next definition stage. - */ - WithCreate withUuid(String uuid); - } - /** The stage of the VirtualMachine definition allowing to specify generation. */ - interface WithGeneration { - /** - * Specifies the generation property: Gets or sets the generation for the vm.. - * - * @param generation Gets or sets the generation for the vm. - * @return the next definition stage. - */ - WithCreate withGeneration(Integer generation); - } - } - /** - * Begins update for the VirtualMachine resource. - * - * @return the stage of resource update. - */ - VirtualMachine.Update update(); - - /** The template for VirtualMachine update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { - /** - * 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. */ - interface UpdateStages { - /** The stage of the VirtualMachine update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Gets or sets the Resource tags.. - * - * @param tags Gets or sets the Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the VirtualMachine update allowing to specify properties. */ - interface WithProperties { - /** - * Specifies the properties property: Defines the resource properties.. - * - * @param properties Defines the resource properties. - * @return the next definition stage. - */ - Update withProperties(VirtualMachineUpdateProperties properties); - } - } - /** - * 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. - */ - VirtualMachine refresh(Context context); - - /** - * Stop virtual machine. - * - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(StopVirtualMachineOptions body); - - /** - * Stop 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. - */ - void stop(); - - /** - * Stop virtual machine. - * - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(StopVirtualMachineOptions body, Context context); - - /** - * Start 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. - */ - void start(); - - /** - * Start 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. - */ - void start(Context context); - - /** - * Restart 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. - */ - void restart(); - - /** - * Restart 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. - */ - void restart(Context context); - - /** - * Creates a checkpoint in virtual machine. - * - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void createCheckpoint(VirtualMachineCreateCheckpoint body); - - /** - * Creates a checkpoint in 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. - */ - void createCheckpoint(); - - /** - * Creates a checkpoint in virtual machine. - * - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void createCheckpoint(VirtualMachineCreateCheckpoint body, Context context); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteCheckpoint(VirtualMachineDeleteCheckpoint body); - - /** - * Deletes a checkpoint in 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. - */ - void deleteCheckpoint(); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteCheckpoint(VirtualMachineDeleteCheckpoint body, Context context); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restoreCheckpoint(VirtualMachineRestoreCheckpoint body); - - /** - * Restores to a checkpoint in 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. - */ - void restoreCheckpoint(); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restoreCheckpoint(VirtualMachineRestoreCheckpoint body, Context context); -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineCreateCheckpoint.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineCreateCheckpoint.java index 86483c0ffe117..4f8ca172af23d 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineCreateCheckpoint.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineCreateCheckpoint.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the create checkpoint action properties. */ +/** + * Defines the create checkpoint action properties. + */ @Fluent public final class VirtualMachineCreateCheckpoint { /* @@ -22,9 +24,15 @@ public final class VirtualMachineCreateCheckpoint { @JsonProperty(value = "description") private String description; + /** + * Creates an instance of VirtualMachineCreateCheckpoint class. + */ + public VirtualMachineCreateCheckpoint() { + } + /** * Get the name property: Name of the checkpoint. - * + * * @return the name value. */ public String name() { @@ -33,7 +41,7 @@ public String name() { /** * Set the name property: Name of the checkpoint. - * + * * @param name the name value to set. * @return the VirtualMachineCreateCheckpoint object itself. */ @@ -44,7 +52,7 @@ public VirtualMachineCreateCheckpoint withName(String name) { /** * Get the description property: Description of the checkpoint. - * + * * @return the description value. */ public String description() { @@ -53,7 +61,7 @@ public String description() { /** * Set the description property: Description of the checkpoint. - * + * * @param description the description value to set. * @return the VirtualMachineCreateCheckpoint object itself. */ @@ -64,7 +72,7 @@ public VirtualMachineCreateCheckpoint withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineDeleteCheckpoint.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineDeleteCheckpoint.java index ba1c5c65157c6..cd5e525d2e82d 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineDeleteCheckpoint.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineDeleteCheckpoint.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the delete checkpoint action properties. */ +/** + * Defines the delete checkpoint action properties. + */ @Fluent public final class VirtualMachineDeleteCheckpoint { /* @@ -16,9 +18,15 @@ public final class VirtualMachineDeleteCheckpoint { @JsonProperty(value = "id") private String id; + /** + * Creates an instance of VirtualMachineDeleteCheckpoint class. + */ + public VirtualMachineDeleteCheckpoint() { + } + /** * Get the id property: ID of the checkpoint to be deleted. - * + * * @return the id value. */ public String id() { @@ -27,7 +35,7 @@ public String id() { /** * Set the id property: ID of the checkpoint to be deleted. - * + * * @param id the id value to set. * @return the VirtualMachineDeleteCheckpoint object itself. */ @@ -38,7 +46,7 @@ public VirtualMachineDeleteCheckpoint withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstance.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstance.java new file mode 100644 index 0000000000000..15f6c889f3eb6 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstance.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.scvmm.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInstanceInner; + +/** + * An immutable client-side representation of VirtualMachineInstance. + */ +public interface VirtualMachineInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + VirtualMachineInstanceProperties properties(); + + /** + * Gets the extendedLocation property: Gets or sets the extended location. + * + * @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 inner com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInstanceInner object. + * + * @return the inner object. + */ + VirtualMachineInstanceInner innerModel(); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceListResult.java new file mode 100644 index 0000000000000..776c975d5b1fb --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a VirtualMachineInstance list operation. + */ +@Fluent +public final class VirtualMachineInstanceListResult { + /* + * The VirtualMachineInstance items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of VirtualMachineInstanceListResult class. + */ + public VirtualMachineInstanceListResult() { + } + + /** + * Get the value property: The VirtualMachineInstance items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The VirtualMachineInstance items on this page. + * + * @param value the value value to set. + * @return the VirtualMachineInstanceListResult object itself. + */ + public VirtualMachineInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the VirtualMachineInstanceListResult object itself. + */ + public VirtualMachineInstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property value in model VirtualMachineInstanceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineInstanceListResult.class); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceProperties.java new file mode 100644 index 0000000000000..c46cc245355a4 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceProperties.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Defines the resource properties. + */ +@Fluent +public final class VirtualMachineInstanceProperties { + /* + * Availability Sets in vm. + */ + @JsonProperty(value = "availabilitySets") + private List availabilitySets; + + /* + * OS properties. + */ + @JsonProperty(value = "osProfile") + private OsProfileForVmInstance osProfile; + + /* + * Hardware properties. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Network properties. + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /* + * Storage properties. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /* + * Gets the infrastructure profile. + */ + @JsonProperty(value = "infrastructureProfile") + private InfrastructureProfile infrastructureProfile; + + /* + * Gets the power state of the virtual machine. + */ + @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) + private String powerState; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualMachineInstanceProperties class. + */ + public VirtualMachineInstanceProperties() { + } + + /** + * Get the availabilitySets property: Availability Sets in vm. + * + * @return the availabilitySets value. + */ + public List availabilitySets() { + return this.availabilitySets; + } + + /** + * Set the availabilitySets property: Availability Sets in vm. + * + * @param availabilitySets the availabilitySets value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withAvailabilitySets(List availabilitySets) { + this.availabilitySets = availabilitySets; + return this; + } + + /** + * Get the osProfile property: OS properties. + * + * @return the osProfile value. + */ + public OsProfileForVmInstance osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: OS properties. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withOsProfile(OsProfileForVmInstance osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the hardwareProfile property: Hardware properties. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Hardware properties. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the networkProfile property: Network properties. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Network properties. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the storageProfile property: Storage properties. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Storage properties. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the infrastructureProfile property: Gets the infrastructure profile. + * + * @return the infrastructureProfile value. + */ + public InfrastructureProfile infrastructureProfile() { + return this.infrastructureProfile; + } + + /** + * Set the infrastructureProfile property: Gets the infrastructure profile. + * + * @param infrastructureProfile the infrastructureProfile value to set. + * @return the VirtualMachineInstanceProperties object itself. + */ + public VirtualMachineInstanceProperties withInfrastructureProfile(InfrastructureProfile infrastructureProfile) { + this.infrastructureProfile = infrastructureProfile; + return this; + } + + /** + * Get the powerState property: Gets the power state of the virtual machine. + * + * @return the powerState value. + */ + public String powerState() { + return this.powerState; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilitySets() != null) { + availabilitySets().forEach(e -> e.validate()); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (infrastructureProfile() != null) { + infrastructureProfile().validate(); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceUpdate.java new file mode 100644 index 0000000000000..30676d2abd4f3 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceUpdate.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The type used for update operations of the VirtualMachineInstance. + */ +@Fluent +public final class VirtualMachineInstanceUpdate { + /* + * Gets or sets the extended location. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The updatable properties of the VirtualMachineInstance. + */ + @JsonProperty(value = "properties") + private VirtualMachineInstanceUpdateProperties properties; + + /** + * Creates an instance of VirtualMachineInstanceUpdate class. + */ + public VirtualMachineInstanceUpdate() { + } + + /** + * Get the extendedLocation property: Gets or sets the extended location. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: Gets or sets the extended location. + * + * @param extendedLocation the extendedLocation value to set. + * @return the VirtualMachineInstanceUpdate object itself. + */ + public VirtualMachineInstanceUpdate withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the properties property: The updatable properties of the VirtualMachineInstance. + * + * @return the properties value. + */ + public VirtualMachineInstanceUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The updatable properties of the VirtualMachineInstance. + * + * @param properties the properties value to set. + * @return the VirtualMachineInstanceUpdate object itself. + */ + public VirtualMachineInstanceUpdate withProperties(VirtualMachineInstanceUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceUpdateProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceUpdateProperties.java new file mode 100644 index 0000000000000..7d6c8ad6061ea --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstanceUpdateProperties.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The updatable properties of the VirtualMachineInstance. + */ +@Fluent +public final class VirtualMachineInstanceUpdateProperties { + /* + * Availability Sets in vm. + */ + @JsonProperty(value = "availabilitySets") + private List availabilitySets; + + /* + * OS properties. + */ + @JsonProperty(value = "osProfile") + private OsProfileForVmInstance osProfile; + + /* + * Hardware properties. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * Network properties. + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /* + * Storage properties. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /* + * Gets the infrastructure profile. + */ + @JsonProperty(value = "infrastructureProfile") + private InfrastructureProfile infrastructureProfile; + + /** + * Creates an instance of VirtualMachineInstanceUpdateProperties class. + */ + public VirtualMachineInstanceUpdateProperties() { + } + + /** + * Get the availabilitySets property: Availability Sets in vm. + * + * @return the availabilitySets value. + */ + public List availabilitySets() { + return this.availabilitySets; + } + + /** + * Set the availabilitySets property: Availability Sets in vm. + * + * @param availabilitySets the availabilitySets value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withAvailabilitySets(List availabilitySets) { + this.availabilitySets = availabilitySets; + return this; + } + + /** + * Get the osProfile property: OS properties. + * + * @return the osProfile value. + */ + public OsProfileForVmInstance osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: OS properties. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withOsProfile(OsProfileForVmInstance osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the hardwareProfile property: Hardware properties. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: Hardware properties. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the networkProfile property: Network properties. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Network properties. + * + * @param networkProfile the networkProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the storageProfile property: Storage properties. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Storage properties. + * + * @param storageProfile the storageProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the infrastructureProfile property: Gets the infrastructure profile. + * + * @return the infrastructureProfile value. + */ + public InfrastructureProfile infrastructureProfile() { + return this.infrastructureProfile; + } + + /** + * Set the infrastructureProfile property: Gets the infrastructure profile. + * + * @param infrastructureProfile the infrastructureProfile value to set. + * @return the VirtualMachineInstanceUpdateProperties object itself. + */ + public VirtualMachineInstanceUpdateProperties + withInfrastructureProfile(InfrastructureProfile infrastructureProfile) { + this.infrastructureProfile = infrastructureProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilitySets() != null) { + availabilitySets().forEach(e -> e.validate()); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (infrastructureProfile() != null) { + infrastructureProfile().validate(); + } + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstances.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstances.java new file mode 100644 index 0000000000000..db813e985da58 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInstances.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInstanceInner; + +/** + * Resource collection API of VirtualMachineInstances. + */ +public interface VirtualMachineInstances { + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VirtualMachineInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * Lists all of the virtual machine instances within the specified parent resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 response of a VirtualMachineInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 define the virtualMachineInstance along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Retrieves information about a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + VirtualMachineInstance get(String resourceUri); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + VirtualMachineInstance createOrUpdate(String resourceUri, VirtualMachineInstanceInner resource); + + /** + * The operation to create or update a virtual machine instance. Please note some properties can be set only during + * virtual machine instance creation. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param resource Resource create parameters. + * @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 define the virtualMachineInstance. + */ + VirtualMachineInstance createOrUpdate(String resourceUri, VirtualMachineInstanceInner resource, Context context); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the virtualMachineInstance. + */ + VirtualMachineInstance update(String resourceUri, VirtualMachineInstanceUpdate properties); + + /** + * The operation to update a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param properties The resource properties to be updated. + * @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 define the virtualMachineInstance. + */ + VirtualMachineInstance update(String resourceUri, VirtualMachineInstanceUpdate properties, Context context); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri); + + /** + * The operation to delete a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param force Forces the resource to be deleted. + * @param deleteFromHost Whether to disable the VM from azure and also delete it from Vmm. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceUri, Boolean force, Boolean deleteFromHost, Context context); + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void createCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body); + + /** + * Creates a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void createCheckpoint(String resourceUri, VirtualMachineCreateCheckpoint body, Context context); + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body); + + /** + * Deletes a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteCheckpoint(String resourceUri, VirtualMachineDeleteCheckpoint body, Context context); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceUri, Object body); + + /** + * The operation to restart a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceUri, Object body, Context context); + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body); + + /** + * Restores to a checkpoint in virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restoreCheckpoint(String resourceUri, VirtualMachineRestoreCheckpoint body, Context context); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceUri, Object body); + + /** + * The operation to start a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceUri, Object body, Context context); + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceUri, StopVirtualMachineOptions body); + + /** + * The operation to power off (stop) a virtual machine instance. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceUri, StopVirtualMachineOptions body, Context context); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInventoryItem.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInventoryItem.java index b59eabfceb9cf..3d8e6a830c7a1 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInventoryItem.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineInventoryItem.java @@ -5,29 +5,36 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** The Virtual machine inventory item. */ +/** + * The Virtual machine inventory item. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inventoryType") @JsonTypeName("VirtualMachine") @Fluent public final class VirtualMachineInventoryItem extends InventoryItemProperties { /* - * Gets or sets the type of the os. + * Gets the type of the os. */ @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) private OsType osType; /* - * Gets or sets os name. + * Gets os name. */ @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) private String osName; + /* + * Gets os version. + */ + @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) + private String osVersion; + /* * Gets the power state of the virtual machine. */ @@ -46,9 +53,27 @@ public final class VirtualMachineInventoryItem extends InventoryItemProperties { @JsonProperty(value = "cloud") private InventoryItemDetails cloud; + /* + * Gets the bios guid. + */ + @JsonProperty(value = "biosGuid", access = JsonProperty.Access.WRITE_ONLY) + private String biosGuid; + + /* + * Gets the tracked resource id corresponding to the inventory resource. + */ + @JsonProperty(value = "managedMachineResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String managedMachineResourceId; + + /** + * Creates an instance of VirtualMachineInventoryItem class. + */ + public VirtualMachineInventoryItem() { + } + /** - * Get the osType property: Gets or sets the type of the os. - * + * Get the osType property: Gets the type of the os. + * * @return the osType value. */ public OsType osType() { @@ -56,17 +81,26 @@ public OsType osType() { } /** - * Get the osName property: Gets or sets os name. - * + * Get the osName property: Gets os name. + * * @return the osName value. */ public String osName() { return this.osName; } + /** + * Get the osVersion property: Gets os version. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + /** * Get the powerState property: Gets the power state of the virtual machine. - * + * * @return the powerState value. */ public String powerState() { @@ -75,7 +109,7 @@ public String powerState() { /** * Get the ipAddresses property: Gets or sets the nic ip addresses. - * + * * @return the ipAddresses value. */ public List ipAddresses() { @@ -84,7 +118,7 @@ public List ipAddresses() { /** * Set the ipAddresses property: Gets or sets the nic ip addresses. - * + * * @param ipAddresses the ipAddresses value to set. * @return the VirtualMachineInventoryItem object itself. */ @@ -95,7 +129,7 @@ public VirtualMachineInventoryItem withIpAddresses(List ipAddresses) { /** * Get the cloud property: Cloud inventory resource details where the VM is present. - * + * * @return the cloud value. */ public InventoryItemDetails cloud() { @@ -104,7 +138,7 @@ public InventoryItemDetails cloud() { /** * Set the cloud property: Cloud inventory resource details where the VM is present. - * + * * @param cloud the cloud value to set. * @return the VirtualMachineInventoryItem object itself. */ @@ -113,9 +147,27 @@ public VirtualMachineInventoryItem withCloud(InventoryItemDetails cloud) { return this; } + /** + * Get the biosGuid property: Gets the bios guid. + * + * @return the biosGuid value. + */ + public String biosGuid() { + return this.biosGuid; + } + + /** + * Get the managedMachineResourceId property: Gets the tracked resource id corresponding to the inventory resource. + * + * @return the managedMachineResourceId value. + */ + public String managedMachineResourceId() { + return this.managedMachineResourceId; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineListResult.java deleted file mode 100644 index bd89734b3c359..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineListResult.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.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of VirtualMachines. */ -@Fluent -public final class VirtualMachineListResult { - /* - * List of VirtualMachines. - */ - @JsonProperty(value = "value") - private List value; - - /* - * Url to follow for getting next page of resources. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: List of VirtualMachines. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of VirtualMachines. - * - * @param value the value value to set. - * @return the VirtualMachineListResult object itself. - */ - public VirtualMachineListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Url to follow for getting next page of resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: Url to follow for getting next page of resources. - * - * @param nextLink the nextLink value to set. - * @return the VirtualMachineListResult object itself. - */ - public VirtualMachineListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - 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()); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineRestoreCheckpoint.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineRestoreCheckpoint.java index 0c83860fc5f15..e138b50fff01d 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineRestoreCheckpoint.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineRestoreCheckpoint.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the restore checkpoint action properties. */ +/** + * Defines the restore checkpoint action properties. + */ @Fluent public final class VirtualMachineRestoreCheckpoint { /* @@ -16,9 +18,15 @@ public final class VirtualMachineRestoreCheckpoint { @JsonProperty(value = "id") private String id; + /** + * Creates an instance of VirtualMachineRestoreCheckpoint class. + */ + public VirtualMachineRestoreCheckpoint() { + } + /** * Get the id property: ID of the checkpoint to be restored to. - * + * * @return the id value. */ public String id() { @@ -27,7 +35,7 @@ public String id() { /** * Set the id property: ID of the checkpoint to be restored to. - * + * * @param id the id value to set. * @return the VirtualMachineRestoreCheckpoint object itself. */ @@ -38,7 +46,7 @@ public VirtualMachineRestoreCheckpoint withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplate.java index ec640c396a1e5..4f2b207636993 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplate.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplate.java @@ -8,226 +8,120 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineTemplateInner; -import java.util.List; import java.util.Map; -/** An immutable client-side representation of VirtualMachineTemplate. */ +/** + * An immutable client-side representation of VirtualMachineTemplate. + */ public interface VirtualMachineTemplate { /** * 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: The system data. - * - * @return the systemData value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - SystemData systemData(); + VirtualMachineTemplateProperties properties(); /** * Gets the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** - * Gets the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - String inventoryItemId(); - - /** - * Gets the uuid property: Unique ID of the virtual machine template. - * - * @return the uuid value. - */ - String uuid(); - - /** - * Gets the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - String vmmServerId(); - - /** - * Gets the osType property: Gets or sets the type of the os. - * - * @return the osType value. - */ - OsType osType(); - - /** - * Gets the osName property: Gets or sets os name. - * - * @return the osName value. - */ - String osName(); - - /** - * Gets the computerName property: Gets or sets computer name. - * - * @return the computerName value. - */ - String computerName(); - - /** - * Gets the memoryMB property: MemoryMB is the desired size of a virtual machine's memory, in MB. - * - * @return the memoryMB value. - */ - Integer memoryMB(); - - /** - * Gets the cpuCount property: Gets or sets the desired number of vCPUs for the vm. - * - * @return the cpuCount value. - */ - Integer cpuCount(); - - /** - * Gets the limitCpuForMigration property: Gets or sets a value indicating whether to enable processor compatibility - * mode for live migration of VMs. - * - * @return the limitCpuForMigration value. - */ - LimitCpuForMigration limitCpuForMigration(); - - /** - * Gets the dynamicMemoryEnabled property: Gets or sets a value indicating whether to enable dynamic memory or not. - * - * @return the dynamicMemoryEnabled value. - */ - DynamicMemoryEnabled dynamicMemoryEnabled(); - - /** - * Gets the isCustomizable property: Gets or sets a value indicating whether the vm template is customizable or not. - * - * @return the isCustomizable value. - */ - IsCustomizable isCustomizable(); - - /** - * Gets the dynamicMemoryMaxMB property: Gets or sets the max dynamic memory for the vm. - * - * @return the dynamicMemoryMaxMB value. - */ - Integer dynamicMemoryMaxMB(); - - /** - * Gets the dynamicMemoryMinMB property: Gets or sets the min dynamic memory for the vm. - * - * @return the dynamicMemoryMinMB value. - */ - Integer dynamicMemoryMinMB(); - - /** - * Gets the isHighlyAvailable property: Gets highly available property. - * - * @return the isHighlyAvailable value. - */ - String isHighlyAvailable(); - - /** - * Gets the generation property: Gets or sets the generation for the vm. - * - * @return the generation value. - */ - Integer generation(); - - /** - * Gets the networkInterfaces property: Gets or sets the network interfaces of the template. - * - * @return the networkInterfaces value. - */ - List networkInterfaces(); - - /** - * Gets the disks property: Gets or sets the disks of the template. - * - * @return the disks value. - */ - List disks(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String provisioningState(); + SystemData systemData(); /** * 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.scvmm.fluent.models.VirtualMachineTemplateInner object. - * + * * @return the inner object. */ VirtualMachineTemplateInner innerModel(); - /** The entirety of the VirtualMachineTemplate definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithExtendedLocation, - DefinitionStages.WithCreate { + /** + * The entirety of the VirtualMachineTemplate definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCreate { } - /** The VirtualMachineTemplate definition stages. */ + + /** + * The VirtualMachineTemplate definition stages. + */ interface DefinitionStages { - /** The first stage of the VirtualMachineTemplate definition. */ + /** + * The first stage of the VirtualMachineTemplate definition. + */ interface Blank extends WithLocation { } - /** The stage of the VirtualMachineTemplate definition allowing to specify location. */ + + /** + * The stage of the VirtualMachineTemplate 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. */ @@ -235,144 +129,142 @@ 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 VirtualMachineTemplate definition allowing to specify parent resource. */ + + /** + * The stage of the VirtualMachineTemplate definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. + * + * @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 VirtualMachineTemplate definition allowing to specify extendedLocation. */ + + /** + * The stage of the VirtualMachineTemplate definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** * Specifies the extendedLocation property: The extended location.. - * + * * @param extendedLocation The extended location. * @return the next definition stage. */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** * The stage of the VirtualMachineTemplate 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.WithInventoryItemId, - DefinitionStages.WithUuid, - DefinitionStages.WithVmmServerId { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ VirtualMachineTemplate create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ VirtualMachineTemplate create(Context context); } - /** The stage of the VirtualMachineTemplate definition allowing to specify tags. */ + + /** + * The stage of the VirtualMachineTemplate 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 VirtualMachineTemplate definition allowing to specify inventoryItemId. */ - interface WithInventoryItemId { - /** - * Specifies the inventoryItemId property: Gets or sets the inventory Item ID for the resource.. - * - * @param inventoryItemId Gets or sets the inventory Item ID for the resource. - * @return the next definition stage. - */ - WithCreate withInventoryItemId(String inventoryItemId); - } - /** The stage of the VirtualMachineTemplate definition allowing to specify uuid. */ - interface WithUuid { - /** - * Specifies the uuid property: Unique ID of the virtual machine template.. - * - * @param uuid Unique ID of the virtual machine template. - * @return the next definition stage. - */ - WithCreate withUuid(String uuid); - } - /** The stage of the VirtualMachineTemplate definition allowing to specify vmmServerId. */ - interface WithVmmServerId { + + /** + * The stage of the VirtualMachineTemplate definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.. - * - * @param vmmServerId ARM Id of the vmmServer resource in which this resource resides. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withVmmServerId(String vmmServerId); + WithCreate withProperties(VirtualMachineTemplateProperties properties); } } + /** * Begins update for the VirtualMachineTemplate resource. - * + * * @return the stage of resource update. */ VirtualMachineTemplate.Update update(); - /** The template for VirtualMachineTemplate update. */ + /** + * The template for VirtualMachineTemplate update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ VirtualMachineTemplate apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ VirtualMachineTemplate apply(Context context); } - /** The VirtualMachineTemplate update stages. */ + + /** + * The VirtualMachineTemplate update stages. + */ interface UpdateStages { - /** The stage of the VirtualMachineTemplate update allowing to specify tags. */ + /** + * The stage of the VirtualMachineTemplate update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ VirtualMachineTemplate 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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateInventoryItem.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateInventoryItem.java index f0691296e4779..d89bf9daaeb16 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateInventoryItem.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateInventoryItem.java @@ -5,18 +5,19 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Virtual machine template inventory item. */ +/** + * The Virtual machine template inventory item. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inventoryType") @JsonTypeName("VirtualMachineTemplate") @Immutable public final class VirtualMachineTemplateInventoryItem extends InventoryItemProperties { /* - * Gets or sets the desired number of vCPUs for the vm. + * Gets the desired number of vCPUs for the vm. */ @JsonProperty(value = "cpuCount", access = JsonProperty.Access.WRITE_ONLY) private Integer cpuCount; @@ -28,20 +29,26 @@ public final class VirtualMachineTemplateInventoryItem extends InventoryItemProp private Integer memoryMB; /* - * Gets or sets the type of the os. + * Gets the type of the os. */ @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) private OsType osType; /* - * Gets or sets os name. + * Gets os name. */ @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) private String osName; /** - * Get the cpuCount property: Gets or sets the desired number of vCPUs for the vm. - * + * Creates an instance of VirtualMachineTemplateInventoryItem class. + */ + public VirtualMachineTemplateInventoryItem() { + } + + /** + * Get the cpuCount property: Gets the desired number of vCPUs for the vm. + * * @return the cpuCount value. */ public Integer cpuCount() { @@ -50,7 +57,7 @@ public Integer cpuCount() { /** * Get the memoryMB property: MemoryMB is the desired size of a virtual machine's memory, in MB. - * + * * @return the memoryMB value. */ public Integer memoryMB() { @@ -58,8 +65,8 @@ public Integer memoryMB() { } /** - * Get the osType property: Gets or sets the type of the os. - * + * Get the osType property: Gets the type of the os. + * * @return the osType value. */ public OsType osType() { @@ -67,8 +74,8 @@ public OsType osType() { } /** - * Get the osName property: Gets or sets os name. - * + * Get the osName property: Gets os name. + * * @return the osName value. */ public String osName() { @@ -77,7 +84,7 @@ public String osName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateListResult.java index 898bc94a55669..cd25d2babec07 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateListResult.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateListResult.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineTemplateInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of VirtualMachineTemplates. */ +/** + * The response of a VirtualMachineTemplate list operation. + */ @Fluent public final class VirtualMachineTemplateListResult { /* - * List of VirtualMachineTemplates. + * The VirtualMachineTemplate items on this page */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", required = true) private List value; /* - * Url to follow for getting next page of resources. + * The link to the next page of items */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: List of VirtualMachineTemplates. - * + * Creates an instance of VirtualMachineTemplateListResult class. + */ + public VirtualMachineTemplateListResult() { + } + + /** + * Get the value property: The VirtualMachineTemplate items on this page. + * * @return the value value. */ public List value() { @@ -34,8 +43,8 @@ public List value() { } /** - * Set the value property: List of VirtualMachineTemplates. - * + * Set the value property: The VirtualMachineTemplate items on this page. + * * @param value the value value to set. * @return the VirtualMachineTemplateListResult object itself. */ @@ -45,8 +54,8 @@ public VirtualMachineTemplateListResult withValue(List e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineTemplateListResult.class); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineTemplateProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateProperties.java similarity index 71% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineTemplateProperties.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateProperties.java index 017bbce09cfee..1c8080b9a7fdd 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualMachineTemplateProperties.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateProperties.java @@ -2,19 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.scvmm.fluent.models; +package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.scvmm.models.DynamicMemoryEnabled; -import com.azure.resourcemanager.scvmm.models.IsCustomizable; -import com.azure.resourcemanager.scvmm.models.LimitCpuForMigration; -import com.azure.resourcemanager.scvmm.models.NetworkInterfaces; -import com.azure.resourcemanager.scvmm.models.OsType; -import com.azure.resourcemanager.scvmm.models.VirtualDisk; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class VirtualMachineTemplateProperties { /* @@ -36,19 +32,19 @@ public final class VirtualMachineTemplateProperties { private String vmmServerId; /* - * Gets or sets the type of the os. + * Gets the type of the os. */ @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) private OsType osType; /* - * Gets or sets os name. + * Gets os name. */ @JsonProperty(value = "osName", access = JsonProperty.Access.WRITE_ONLY) private String osName; /* - * Gets or sets computer name. + * Gets computer name. */ @JsonProperty(value = "computerName", access = JsonProperty.Access.WRITE_ONLY) private String computerName; @@ -60,39 +56,37 @@ public final class VirtualMachineTemplateProperties { private Integer memoryMB; /* - * Gets or sets the desired number of vCPUs for the vm. + * Gets the desired number of vCPUs for the vm. */ @JsonProperty(value = "cpuCount", access = JsonProperty.Access.WRITE_ONLY) private Integer cpuCount; /* - * Gets or sets a value indicating whether to enable processor - * compatibility mode for live migration of VMs. + * Gets a value indicating whether to enable processor compatibility mode for live migration of VMs. */ @JsonProperty(value = "limitCpuForMigration", access = JsonProperty.Access.WRITE_ONLY) private LimitCpuForMigration limitCpuForMigration; /* - * Gets or sets a value indicating whether to enable dynamic memory or not. + * Gets a value indicating whether to enable dynamic memory or not. */ @JsonProperty(value = "dynamicMemoryEnabled", access = JsonProperty.Access.WRITE_ONLY) private DynamicMemoryEnabled dynamicMemoryEnabled; /* - * Gets or sets a value indicating whether the vm template is customizable - * or not. + * Gets a value indicating whether the vm template is customizable or not. */ @JsonProperty(value = "isCustomizable", access = JsonProperty.Access.WRITE_ONLY) private IsCustomizable isCustomizable; /* - * Gets or sets the max dynamic memory for the vm. + * Gets the max dynamic memory for the vm. */ @JsonProperty(value = "dynamicMemoryMaxMB", access = JsonProperty.Access.WRITE_ONLY) private Integer dynamicMemoryMaxMB; /* - * Gets or sets the min dynamic memory for the vm. + * Gets the min dynamic memory for the vm. */ @JsonProperty(value = "dynamicMemoryMinMB", access = JsonProperty.Access.WRITE_ONLY) private Integer dynamicMemoryMinMB; @@ -101,35 +95,41 @@ public final class VirtualMachineTemplateProperties { * Gets highly available property. */ @JsonProperty(value = "isHighlyAvailable", access = JsonProperty.Access.WRITE_ONLY) - private String isHighlyAvailable; + private IsHighlyAvailable isHighlyAvailable; /* - * Gets or sets the generation for the vm. + * Gets the generation for the vm. */ @JsonProperty(value = "generation", access = JsonProperty.Access.WRITE_ONLY) private Integer generation; /* - * Gets or sets the network interfaces of the template. + * Gets the network interfaces of the template. */ @JsonProperty(value = "networkInterfaces", access = JsonProperty.Access.WRITE_ONLY) - private List networkInterfaces; + private List networkInterfaces; /* - * Gets or sets the disks of the template. + * Gets the disks of the template. */ @JsonProperty(value = "disks", access = JsonProperty.Access.WRITE_ONLY) private List disks; /* - * Gets or sets the provisioning state. + * Provisioning state of the resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualMachineTemplateProperties class. + */ + public VirtualMachineTemplateProperties() { + } /** * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * + * * @return the inventoryItemId value. */ public String inventoryItemId() { @@ -138,7 +138,7 @@ public String inventoryItemId() { /** * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * + * * @param inventoryItemId the inventoryItemId value to set. * @return the VirtualMachineTemplateProperties object itself. */ @@ -149,7 +149,7 @@ public VirtualMachineTemplateProperties withInventoryItemId(String inventoryItem /** * Get the uuid property: Unique ID of the virtual machine template. - * + * * @return the uuid value. */ public String uuid() { @@ -158,7 +158,7 @@ public String uuid() { /** * Set the uuid property: Unique ID of the virtual machine template. - * + * * @param uuid the uuid value to set. * @return the VirtualMachineTemplateProperties object itself. */ @@ -169,7 +169,7 @@ public VirtualMachineTemplateProperties withUuid(String uuid) { /** * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * + * * @return the vmmServerId value. */ public String vmmServerId() { @@ -178,7 +178,7 @@ public String vmmServerId() { /** * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * + * * @param vmmServerId the vmmServerId value to set. * @return the VirtualMachineTemplateProperties object itself. */ @@ -188,8 +188,8 @@ public VirtualMachineTemplateProperties withVmmServerId(String vmmServerId) { } /** - * Get the osType property: Gets or sets the type of the os. - * + * Get the osType property: Gets the type of the os. + * * @return the osType value. */ public OsType osType() { @@ -197,8 +197,8 @@ public OsType osType() { } /** - * Get the osName property: Gets or sets os name. - * + * Get the osName property: Gets os name. + * * @return the osName value. */ public String osName() { @@ -206,8 +206,8 @@ public String osName() { } /** - * Get the computerName property: Gets or sets computer name. - * + * Get the computerName property: Gets computer name. + * * @return the computerName value. */ public String computerName() { @@ -216,7 +216,7 @@ public String computerName() { /** * Get the memoryMB property: MemoryMB is the desired size of a virtual machine's memory, in MB. - * + * * @return the memoryMB value. */ public Integer memoryMB() { @@ -224,8 +224,8 @@ public Integer memoryMB() { } /** - * Get the cpuCount property: Gets or sets the desired number of vCPUs for the vm. - * + * Get the cpuCount property: Gets the desired number of vCPUs for the vm. + * * @return the cpuCount value. */ public Integer cpuCount() { @@ -233,9 +233,9 @@ public Integer cpuCount() { } /** - * Get the limitCpuForMigration property: Gets or sets a value indicating whether to enable processor compatibility - * mode for live migration of VMs. - * + * Get the limitCpuForMigration property: Gets a value indicating whether to enable processor compatibility mode + * for live migration of VMs. + * * @return the limitCpuForMigration value. */ public LimitCpuForMigration limitCpuForMigration() { @@ -243,8 +243,8 @@ public LimitCpuForMigration limitCpuForMigration() { } /** - * Get the dynamicMemoryEnabled property: Gets or sets a value indicating whether to enable dynamic memory or not. - * + * Get the dynamicMemoryEnabled property: Gets a value indicating whether to enable dynamic memory or not. + * * @return the dynamicMemoryEnabled value. */ public DynamicMemoryEnabled dynamicMemoryEnabled() { @@ -252,8 +252,8 @@ public DynamicMemoryEnabled dynamicMemoryEnabled() { } /** - * Get the isCustomizable property: Gets or sets a value indicating whether the vm template is customizable or not. - * + * Get the isCustomizable property: Gets a value indicating whether the vm template is customizable or not. + * * @return the isCustomizable value. */ public IsCustomizable isCustomizable() { @@ -261,8 +261,8 @@ public IsCustomizable isCustomizable() { } /** - * Get the dynamicMemoryMaxMB property: Gets or sets the max dynamic memory for the vm. - * + * Get the dynamicMemoryMaxMB property: Gets the max dynamic memory for the vm. + * * @return the dynamicMemoryMaxMB value. */ public Integer dynamicMemoryMaxMB() { @@ -270,8 +270,8 @@ public Integer dynamicMemoryMaxMB() { } /** - * Get the dynamicMemoryMinMB property: Gets or sets the min dynamic memory for the vm. - * + * Get the dynamicMemoryMinMB property: Gets the min dynamic memory for the vm. + * * @return the dynamicMemoryMinMB value. */ public Integer dynamicMemoryMinMB() { @@ -280,16 +280,16 @@ public Integer dynamicMemoryMinMB() { /** * Get the isHighlyAvailable property: Gets highly available property. - * + * * @return the isHighlyAvailable value. */ - public String isHighlyAvailable() { + public IsHighlyAvailable isHighlyAvailable() { return this.isHighlyAvailable; } /** - * Get the generation property: Gets or sets the generation for the vm. - * + * Get the generation property: Gets the generation for the vm. + * * @return the generation value. */ public Integer generation() { @@ -297,17 +297,17 @@ public Integer generation() { } /** - * Get the networkInterfaces property: Gets or sets the network interfaces of the template. - * + * Get the networkInterfaces property: Gets the network interfaces of the template. + * * @return the networkInterfaces value. */ - public List networkInterfaces() { + public List networkInterfaces() { return this.networkInterfaces; } /** - * Get the disks property: Gets or sets the disks of the template. - * + * Get the disks property: Gets the disks of the template. + * * @return the disks value. */ public List disks() { @@ -315,17 +315,17 @@ public List disks() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. - * + * Get the provisioningState property: Provisioning state of the resource. + * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateTagsUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateTagsUpdate.java new file mode 100644 index 0000000000000..a55f136e9df0e --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplateTagsUpdate.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.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The type used for updating tags in VirtualMachineTemplate resources. + */ +@Fluent +public final class VirtualMachineTemplateTagsUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Creates an instance of VirtualMachineTemplateTagsUpdate class. + */ + public VirtualMachineTemplateTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VirtualMachineTemplateTagsUpdate object itself. + */ + public VirtualMachineTemplateTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplates.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplates.java index 11730fef48994..2863253e98fc4 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplates.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineTemplates.java @@ -8,118 +8,106 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of VirtualMachineTemplates. */ +/** + * Resource collection API of VirtualMachineTemplates. + */ public interface VirtualMachineTemplates { /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VirtualMachineTemplates in a 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 the VirtualMachineTemplates resource definition. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - VirtualMachineTemplate getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName); + PagedIterable list(); /** - * Implements VirtualMachineTemplate GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * List of VirtualMachineTemplates in a 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 the VirtualMachineTemplates resource definition along with {@link Response}. + * @return the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineTemplateName, Context context); + PagedIterable list(Context context); /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * List of VirtualMachineTemplates in a 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 the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * List of VirtualMachineTemplates in a 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 the response of a VirtualMachineTemplate list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String virtualMachineTemplateName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deregisters the ScVmm VM Template from Azure. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. * @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 VirtualMachineTemplates resource definition along with {@link Response}. */ - void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualMachineTemplateName, Context context); /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualMachineTemplate GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. + * @return the VirtualMachineTemplates resource definition. */ - PagedIterable listByResourceGroup(String resourceGroupName); + VirtualMachineTemplate getByResourceGroup(String resourceGroupName, String virtualMachineTemplateName); /** - * List of VirtualMachineTemplates in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List of VirtualMachineTemplates in a 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 list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); + void delete(String resourceGroupName, String virtualMachineTemplateName); /** - * List of VirtualMachineTemplates in a subscription. - * + * Deregisters the ScVmm VM Template from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualMachineTemplateName Name of the VirtualMachineTemplate. + * @param force Forces the resource to be deleted. * @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 list of VirtualMachineTemplates as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + void delete(String resourceGroupName, String virtualMachineTemplateName, Boolean force, Context context); /** * Implements VirtualMachineTemplate GET method. - * + * * @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. @@ -130,7 +118,7 @@ Response getByResourceGroupWithResponse( /** * Implements VirtualMachineTemplate GET method. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,7 +130,7 @@ Response getByResourceGroupWithResponse( /** * Deregisters the ScVmm VM Template from Azure. - * + * * @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. @@ -152,10 +140,9 @@ Response getByResourceGroupWithResponse( /** * Deregisters the ScVmm VM Template from Azure. - * + * * @param id the resource ID. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param force Forces the resource to be deleted. * @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. @@ -165,7 +152,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new VirtualMachineTemplate resource. - * + * * @param name resource name. * @return the first stage of the new VirtualMachineTemplate definition. */ diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineUpdate.java deleted file mode 100644 index c2772364c22f7..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineUpdate.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.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Defines the virtualMachineUpdate. */ -@Fluent -public final class VirtualMachineUpdate { - /* - * Defines the resource properties. - */ - @JsonProperty(value = "properties") - private VirtualMachineUpdateProperties properties; - - /* - * Gets or sets the Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** - * Get the properties property: Defines the resource properties. - * - * @return the properties value. - */ - public VirtualMachineUpdateProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Defines the resource properties. - * - * @param properties the properties value to set. - * @return the VirtualMachineUpdate object itself. - */ - public VirtualMachineUpdate withProperties(VirtualMachineUpdateProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Gets or sets the Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Gets or sets the Resource tags. - * - * @param tags the tags value to set. - * @return the VirtualMachineUpdate object itself. - */ - public VirtualMachineUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineUpdateProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineUpdateProperties.java deleted file mode 100644 index d4f05b1fd792e..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachineUpdateProperties.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Defines the resource properties. */ -@Fluent -public final class VirtualMachineUpdateProperties { - /* - * Defines the resource properties. - */ - @JsonProperty(value = "hardwareProfile") - private HardwareProfileUpdate hardwareProfile; - - /* - * Defines the resource properties. - */ - @JsonProperty(value = "storageProfile") - private StorageProfileUpdate storageProfile; - - /* - * Defines the resource properties. - */ - @JsonProperty(value = "networkProfile") - private NetworkProfileUpdate networkProfile; - - /* - * Availability Sets in vm. - */ - @JsonProperty(value = "availabilitySets") - private List availabilitySets; - - /** - * Get the hardwareProfile property: Defines the resource properties. - * - * @return the hardwareProfile value. - */ - public HardwareProfileUpdate hardwareProfile() { - return this.hardwareProfile; - } - - /** - * Set the hardwareProfile property: Defines the resource properties. - * - * @param hardwareProfile the hardwareProfile value to set. - * @return the VirtualMachineUpdateProperties object itself. - */ - public VirtualMachineUpdateProperties withHardwareProfile(HardwareProfileUpdate hardwareProfile) { - this.hardwareProfile = hardwareProfile; - return this; - } - - /** - * Get the storageProfile property: Defines the resource properties. - * - * @return the storageProfile value. - */ - public StorageProfileUpdate storageProfile() { - return this.storageProfile; - } - - /** - * Set the storageProfile property: Defines the resource properties. - * - * @param storageProfile the storageProfile value to set. - * @return the VirtualMachineUpdateProperties object itself. - */ - public VirtualMachineUpdateProperties withStorageProfile(StorageProfileUpdate storageProfile) { - this.storageProfile = storageProfile; - return this; - } - - /** - * Get the networkProfile property: Defines the resource properties. - * - * @return the networkProfile value. - */ - public NetworkProfileUpdate networkProfile() { - return this.networkProfile; - } - - /** - * Set the networkProfile property: Defines the resource properties. - * - * @param networkProfile the networkProfile value to set. - * @return the VirtualMachineUpdateProperties object itself. - */ - public VirtualMachineUpdateProperties withNetworkProfile(NetworkProfileUpdate networkProfile) { - this.networkProfile = networkProfile; - return this; - } - - /** - * Get the availabilitySets property: Availability Sets in vm. - * - * @return the availabilitySets value. - */ - public List availabilitySets() { - return this.availabilitySets; - } - - /** - * Set the availabilitySets property: Availability Sets in vm. - * - * @param availabilitySets the availabilitySets value to set. - * @return the VirtualMachineUpdateProperties object itself. - */ - public VirtualMachineUpdateProperties withAvailabilitySets(List availabilitySets) { - this.availabilitySets = availabilitySets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hardwareProfile() != null) { - hardwareProfile().validate(); - } - if (storageProfile() != null) { - storageProfile().validate(); - } - if (networkProfile() != null) { - networkProfile().validate(); - } - if (availabilitySets() != null) { - availabilitySets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachines.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachines.java deleted file mode 100644 index fb093d4afe8cf..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualMachines.java +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.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 VirtualMachines. */ -public interface VirtualMachines { - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the VirtualMachines resource definition. - */ - VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName); - - /** - * Implements VirtualMachine GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @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 VirtualMachines resource definition along with {@link Response}. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualMachineName, Context context); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String virtualMachineName); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String virtualMachineName, Boolean retain, Boolean force, Context context); - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body); - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String resourceGroupName, String virtualMachineName); - - /** - * Stop virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine stop action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context); - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String resourceGroupName, String virtualMachineName); - - /** - * Start virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void start(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restart(String resourceGroupName, String virtualMachineName); - - /** - * Restart virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restart(String resourceGroupName, String virtualMachineName, Context context); - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void createCheckpoint(String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body); - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void createCheckpoint(String resourceGroupName, String virtualMachineName); - - /** - * Creates a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine create checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void createCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineCreateCheckpoint body, Context context); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteCheckpoint(String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteCheckpoint(String resourceGroupName, String virtualMachineName); - - /** - * Deletes a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine delete checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineDeleteCheckpoint body, Context context); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restoreCheckpoint(String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restoreCheckpoint(String resourceGroupName, String virtualMachineName); - - /** - * Restores to a checkpoint in virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param virtualMachineName Name of the VirtualMachine. - * @param body Virtualmachine restore checkpoint action payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void restoreCheckpoint( - String resourceGroupName, String virtualMachineName, VirtualMachineRestoreCheckpoint body, Context context); - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List of VirtualMachines in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List of VirtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List of VirtualMachines in a 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 list of VirtualMachines as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Implements VirtualMachine GET method. - * - * @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 VirtualMachines resource definition along with {@link Response}. - */ - VirtualMachine getById(String id); - - /** - * Implements VirtualMachine GET method. - * - * @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 VirtualMachines resource definition along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @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. - */ - void deleteById(String id); - - /** - * Deletes a VirtualMachine deployed on ScVmm fabric. - * - * @param id the resource ID. - * @param retain Whether to just disable the VM from azure and retain the VM in the VMM. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Boolean retain, Boolean force, Context context); - - /** - * Begins definition for a new VirtualMachine resource. - * - * @param name resource name. - * @return the first stage of the new VirtualMachine definition. - */ - VirtualMachine.DefinitionStages.Blank define(String name); -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetwork.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetwork.java index f9bf172f481d5..1e27f728d3c5e 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetwork.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetwork.java @@ -10,131 +10,118 @@ import com.azure.resourcemanager.scvmm.fluent.models.VirtualNetworkInner; import java.util.Map; -/** An immutable client-side representation of VirtualNetwork. */ +/** + * An immutable client-side representation of VirtualNetwork. + */ public interface VirtualNetwork { /** * 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: The system data. - * - * @return the systemData value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - SystemData systemData(); + VirtualNetworkProperties properties(); /** * Gets the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** - * Gets the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * - * @return the inventoryItemId value. - */ - String inventoryItemId(); - - /** - * Gets the uuid property: Unique ID of the virtual network. - * - * @return the uuid value. - */ - String uuid(); - - /** - * Gets the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * - * @return the vmmServerId value. - */ - String vmmServerId(); - - /** - * Gets the networkName property: Name of the virtual network in vmmServer. - * - * @return the networkName value. - */ - String networkName(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String provisioningState(); + SystemData systemData(); /** * 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.scvmm.fluent.models.VirtualNetworkInner object. - * + * * @return the inner object. */ VirtualNetworkInner innerModel(); - /** The entirety of the VirtualNetwork definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithExtendedLocation, - DefinitionStages.WithCreate { + /** + * The entirety of the VirtualNetwork definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCreate { } - /** The VirtualNetwork definition stages. */ + + /** + * The VirtualNetwork definition stages. + */ interface DefinitionStages { - /** The first stage of the VirtualNetwork definition. */ + /** + * The first stage of the VirtualNetwork definition. + */ interface Blank extends WithLocation { } - /** The stage of the VirtualNetwork definition allowing to specify location. */ + + /** + * The stage of the VirtualNetwork 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. */ @@ -142,144 +129,142 @@ 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 VirtualNetwork definition allowing to specify parent resource. */ + + /** + * The stage of the VirtualNetwork definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. + * + * @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 VirtualNetwork definition allowing to specify extendedLocation. */ + + /** + * The stage of the VirtualNetwork definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** * Specifies the extendedLocation property: The extended location.. - * + * * @param extendedLocation The extended location. * @return the next definition stage. */ WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** * The stage of the VirtualNetwork 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.WithInventoryItemId, - DefinitionStages.WithUuid, - DefinitionStages.WithVmmServerId { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ VirtualNetwork create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ VirtualNetwork create(Context context); } - /** The stage of the VirtualNetwork definition allowing to specify tags. */ + + /** + * The stage of the VirtualNetwork 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 VirtualNetwork definition allowing to specify inventoryItemId. */ - interface WithInventoryItemId { - /** - * Specifies the inventoryItemId property: Gets or sets the inventory Item ID for the resource.. - * - * @param inventoryItemId Gets or sets the inventory Item ID for the resource. - * @return the next definition stage. - */ - WithCreate withInventoryItemId(String inventoryItemId); - } - /** The stage of the VirtualNetwork definition allowing to specify uuid. */ - interface WithUuid { - /** - * Specifies the uuid property: Unique ID of the virtual network.. - * - * @param uuid Unique ID of the virtual network. - * @return the next definition stage. - */ - WithCreate withUuid(String uuid); - } - /** The stage of the VirtualNetwork definition allowing to specify vmmServerId. */ - interface WithVmmServerId { + + /** + * The stage of the VirtualNetwork definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides.. - * - * @param vmmServerId ARM Id of the vmmServer resource in which this resource resides. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withVmmServerId(String vmmServerId); + WithCreate withProperties(VirtualNetworkProperties properties); } } + /** * Begins update for the VirtualNetwork resource. - * + * * @return the stage of resource update. */ VirtualNetwork.Update update(); - /** The template for VirtualNetwork update. */ + /** + * The template for VirtualNetwork update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ VirtualNetwork apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ VirtualNetwork apply(Context context); } - /** The VirtualNetwork update stages. */ + + /** + * The VirtualNetwork update stages. + */ interface UpdateStages { - /** The stage of the VirtualNetwork update allowing to specify tags. */ + /** + * The stage of the VirtualNetwork update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ VirtualNetwork 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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkInventoryItem.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkInventoryItem.java index 6df26a0994154..42d975ebe1409 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkInventoryItem.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkInventoryItem.java @@ -5,18 +5,25 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.scvmm.fluent.models.InventoryItemProperties; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Virtual network inventory item. */ +/** + * The Virtual network inventory item. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "inventoryType") @JsonTypeName("VirtualNetwork") @Immutable public final class VirtualNetworkInventoryItem extends InventoryItemProperties { + /** + * Creates an instance of VirtualNetworkInventoryItem class. + */ + public VirtualNetworkInventoryItem() { + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkListResult.java index 61200ecfeccf4..634349f38e199 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkListResult.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkListResult.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.scvmm.fluent.models.VirtualNetworkInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of VirtualNetworks. */ +/** + * The response of a VirtualNetwork list operation. + */ @Fluent public final class VirtualNetworkListResult { /* - * List of VirtualNetworks. + * The VirtualNetwork items on this page */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", required = true) private List value; /* - * Url to follow for getting next page of resources. + * The link to the next page of items */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: List of VirtualNetworks. - * + * Creates an instance of VirtualNetworkListResult class. + */ + public VirtualNetworkListResult() { + } + + /** + * Get the value property: The VirtualNetwork items on this page. + * * @return the value value. */ public List value() { @@ -34,8 +43,8 @@ public List value() { } /** - * Set the value property: List of VirtualNetworks. - * + * Set the value property: The VirtualNetwork items on this page. + * * @param value the value value to set. * @return the VirtualNetworkListResult object itself. */ @@ -45,8 +54,8 @@ public VirtualNetworkListResult withValue(List value) { } /** - * Get the nextLink property: Url to follow for getting next page of resources. - * + * Get the nextLink property: The link to the next page of items. + * * @return the nextLink value. */ public String nextLink() { @@ -54,8 +63,8 @@ public String nextLink() { } /** - * Set the nextLink property: Url to follow for getting next page of resources. - * + * Set the nextLink property: The link to the next page of items. + * * @param nextLink the nextLink value to set. * @return the VirtualNetworkListResult object itself. */ @@ -66,12 +75,17 @@ public VirtualNetworkListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model VirtualNetworkListResult")); + } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkListResult.class); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualNetworkProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkProperties.java similarity index 86% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualNetworkProperties.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkProperties.java index edb26c1410650..b4733b2c407ba 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VirtualNetworkProperties.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkProperties.java @@ -2,12 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.scvmm.fluent.models; +package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class VirtualNetworkProperties { /* @@ -35,14 +37,20 @@ public final class VirtualNetworkProperties { private String networkName; /* - * Gets or sets the provisioning state. + * Provisioning state of the resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualNetworkProperties class. + */ + public VirtualNetworkProperties() { + } /** * Get the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * + * * @return the inventoryItemId value. */ public String inventoryItemId() { @@ -51,7 +59,7 @@ public String inventoryItemId() { /** * Set the inventoryItemId property: Gets or sets the inventory Item ID for the resource. - * + * * @param inventoryItemId the inventoryItemId value to set. * @return the VirtualNetworkProperties object itself. */ @@ -62,7 +70,7 @@ public VirtualNetworkProperties withInventoryItemId(String inventoryItemId) { /** * Get the uuid property: Unique ID of the virtual network. - * + * * @return the uuid value. */ public String uuid() { @@ -71,7 +79,7 @@ public String uuid() { /** * Set the uuid property: Unique ID of the virtual network. - * + * * @param uuid the uuid value to set. * @return the VirtualNetworkProperties object itself. */ @@ -82,7 +90,7 @@ public VirtualNetworkProperties withUuid(String uuid) { /** * Get the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * + * * @return the vmmServerId value. */ public String vmmServerId() { @@ -91,7 +99,7 @@ public String vmmServerId() { /** * Set the vmmServerId property: ARM Id of the vmmServer resource in which this resource resides. - * + * * @param vmmServerId the vmmServerId value to set. * @return the VirtualNetworkProperties object itself. */ @@ -102,7 +110,7 @@ public VirtualNetworkProperties withVmmServerId(String vmmServerId) { /** * Get the networkName property: Name of the virtual network in vmmServer. - * + * * @return the networkName value. */ public String networkName() { @@ -110,17 +118,17 @@ public String networkName() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. - * + * Get the provisioningState property: Provisioning state of the resource. + * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkTagsUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkTagsUpdate.java new file mode 100644 index 0000000000000..19e0629dc75de --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworkTagsUpdate.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.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The type used for updating tags in VirtualNetwork resources. + */ +@Fluent +public final class VirtualNetworkTagsUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Creates an instance of VirtualNetworkTagsUpdate class. + */ + public VirtualNetworkTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VirtualNetworkTagsUpdate object itself. + */ + public VirtualNetworkTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworks.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworks.java index 2cbe5de1dda5e..4514084e8d7c4 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworks.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VirtualNetworks.java @@ -8,118 +8,106 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of VirtualNetworks. */ +/** + * Resource collection API of VirtualNetworks. + */ public interface VirtualNetworks { /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VirtualNetworks in a 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 the VirtualNetworks resource definition. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName); + PagedIterable list(); /** - * Implements VirtualNetwork GET method. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. + * List of VirtualNetworks in a 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 the VirtualNetworks resource definition along with {@link Response}. + * @return the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String virtualNetworkName, Context context); + PagedIterable list(Context context); /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * List of VirtualNetworks in a 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 the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String virtualNetworkName, Boolean force); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param virtualNetworkName Name of the VirtualNetwork. + * List of VirtualNetworks in a 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 the response of a VirtualNetwork list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String virtualNetworkName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deregisters the ScVmm virtual network from Azure. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param virtualNetworkName Name of the VirtualNetwork. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. * @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 VirtualNetworks resource definition along with {@link Response}. */ - void delete(String resourceGroupName, String virtualNetworkName, Boolean force, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualNetworkName, + Context context); /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Implements VirtualNetwork GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedIterable}. + * @return the VirtualNetworks resource definition. */ - PagedIterable listByResourceGroup(String resourceGroupName); + VirtualNetwork getByResourceGroup(String resourceGroupName, String virtualNetworkName); /** - * List of VirtualNetworks in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VirtualNetworks as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List of VirtualNetworks in a 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 list of VirtualNetworks as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); + void delete(String resourceGroupName, String virtualNetworkName); /** - * List of VirtualNetworks in a subscription. - * + * Deregisters the ScVmm virtual network from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param virtualNetworkName Name of the VirtualNetwork. + * @param force Forces the resource to be deleted. * @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 list of VirtualNetworks as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + void delete(String resourceGroupName, String virtualNetworkName, Boolean force, Context context); /** * Implements VirtualNetwork GET method. - * + * * @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. @@ -130,7 +118,7 @@ Response getByResourceGroupWithResponse( /** * Implements VirtualNetwork GET method. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -142,7 +130,7 @@ Response getByResourceGroupWithResponse( /** * Deregisters the ScVmm virtual network from Azure. - * + * * @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. @@ -152,10 +140,9 @@ Response getByResourceGroupWithResponse( /** * Deregisters the ScVmm virtual network from Azure. - * + * * @param id the resource ID. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param force Forces the resource to be deleted. * @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. @@ -165,7 +152,7 @@ Response getByResourceGroupWithResponse( /** * Begins definition for a new VirtualNetwork resource. - * + * * @param name resource name. * @return the first stage of the new VirtualNetwork definition. */ diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadata.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadata.java new file mode 100644 index 0000000000000..c1acbd08620ad --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadata.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.scvmm.fluent.models.VmInstanceHybridIdentityMetadataInner; + +/** + * An immutable client-side representation of VmInstanceHybridIdentityMetadata. + */ +public interface VmInstanceHybridIdentityMetadata { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + VmInstanceHybridIdentityMetadataProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.scvmm.fluent.models.VmInstanceHybridIdentityMetadataInner object. + * + * @return the inner object. + */ + VmInstanceHybridIdentityMetadataInner innerModel(); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadataListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadataListResult.java new file mode 100644 index 0000000000000..a7e06b1cc1538 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadataListResult.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.scvmm.fluent.models.VmInstanceHybridIdentityMetadataInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a VmInstanceHybridIdentityMetadata list operation. + */ +@Fluent +public final class VmInstanceHybridIdentityMetadataListResult { + /* + * The VmInstanceHybridIdentityMetadata items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of VmInstanceHybridIdentityMetadataListResult class. + */ + public VmInstanceHybridIdentityMetadataListResult() { + } + + /** + * Get the value property: The VmInstanceHybridIdentityMetadata items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The VmInstanceHybridIdentityMetadata items on this page. + * + * @param value the value value to set. + * @return the VmInstanceHybridIdentityMetadataListResult object itself. + */ + public VmInstanceHybridIdentityMetadataListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the VmInstanceHybridIdentityMetadataListResult object itself. + */ + public VmInstanceHybridIdentityMetadataListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property value in model VmInstanceHybridIdentityMetadataListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VmInstanceHybridIdentityMetadataListResult.class); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadataProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadataProperties.java new file mode 100644 index 0000000000000..1eea5e41a6c41 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadataProperties.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of Hybrid Identity Metadata for a Virtual Machine. + */ +@Fluent +public final class VmInstanceHybridIdentityMetadataProperties { + /* + * The unique identifier for the resource. + */ + @JsonProperty(value = "resourceUid") + private String resourceUid; + + /* + * Gets or sets the Public Key. + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Creates an instance of VmInstanceHybridIdentityMetadataProperties class. + */ + public VmInstanceHybridIdentityMetadataProperties() { + } + + /** + * Get the resourceUid property: The unique identifier for the resource. + * + * @return the resourceUid value. + */ + public String resourceUid() { + return this.resourceUid; + } + + /** + * Set the resourceUid property: The unique identifier for the resource. + * + * @param resourceUid the resourceUid value to set. + * @return the VmInstanceHybridIdentityMetadataProperties object itself. + */ + public VmInstanceHybridIdentityMetadataProperties withResourceUid(String resourceUid) { + this.resourceUid = resourceUid; + return this; + } + + /** + * Get the publicKey property: Gets or sets the Public Key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: Gets or sets the Public Key. + * + * @param publicKey the publicKey value to set. + * @return the VmInstanceHybridIdentityMetadataProperties object itself. + */ + public VmInstanceHybridIdentityMetadataProperties withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadatas.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadatas.java new file mode 100644 index 0000000000000..1a861249e85c0 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmInstanceHybridIdentityMetadatas.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.scvmm.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 VmInstanceHybridIdentityMetadatas. + */ +public interface VmInstanceHybridIdentityMetadatas { + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a VmInstanceHybridIdentityMetadata list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByVirtualMachineInstance(String resourceUri); + + /** + * Returns the list of HybridIdentityMetadata of the given VM. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 response of a VmInstanceHybridIdentityMetadata list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByVirtualMachineInstance(String resourceUri, Context context); + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @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 defines the HybridIdentityMetadata along with {@link Response}. + */ + Response getWithResponse(String resourceUri, Context context); + + /** + * Implements HybridIdentityMetadata GET method. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the HybridIdentityMetadata. + */ + VmInstanceHybridIdentityMetadata get(String resourceUri); +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerPropertiesCredentials.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmCredential.java similarity index 64% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerPropertiesCredentials.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmCredential.java index e2827163e05b3..10cf6d85824bf 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerPropertiesCredentials.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmCredential.java @@ -7,24 +7,32 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Credentials to connect to VMMServer. */ +/** + * Credentials to connect to VmmServer. + */ @Fluent -public final class VmmServerPropertiesCredentials { +public final class VmmCredential { /* - * Username to use to connect to VMMServer. + * Username to use to connect to VmmServer. */ @JsonProperty(value = "username") private String username; /* - * Credentials to use to connect to VMMServer. + * Password to use to connect to VmmServer. */ @JsonProperty(value = "password") private String password; /** - * Get the username property: Username to use to connect to VMMServer. - * + * Creates an instance of VmmCredential class. + */ + public VmmCredential() { + } + + /** + * Get the username property: Username to use to connect to VmmServer. + * * @return the username value. */ public String username() { @@ -32,19 +40,19 @@ public String username() { } /** - * Set the username property: Username to use to connect to VMMServer. - * + * Set the username property: Username to use to connect to VmmServer. + * * @param username the username value to set. - * @return the VmmServerPropertiesCredentials object itself. + * @return the VmmCredential object itself. */ - public VmmServerPropertiesCredentials withUsername(String username) { + public VmmCredential withUsername(String username) { this.username = username; return this; } /** - * Get the password property: Credentials to use to connect to VMMServer. - * + * Get the password property: Password to use to connect to VmmServer. + * * @return the password value. */ public String password() { @@ -52,19 +60,19 @@ public String password() { } /** - * Set the password property: Credentials to use to connect to VMMServer. - * + * Set the password property: Password to use to connect to VmmServer. + * * @param password the password value to set. - * @return the VmmServerPropertiesCredentials object itself. + * @return the VmmCredential object itself. */ - public VmmServerPropertiesCredentials withPassword(String password) { + public VmmCredential withPassword(String password) { this.password = password; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServer.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServer.java index 94a4d83a9e384..81935937c09ac 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServer.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServer.java @@ -10,153 +10,118 @@ import com.azure.resourcemanager.scvmm.fluent.models.VmmServerInner; import java.util.Map; -/** An immutable client-side representation of VmmServer. */ +/** + * An immutable client-side representation of VmmServer. + */ public interface VmmServer { /** * 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: The system data. - * - * @return the systemData value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - SystemData systemData(); + VmmServerProperties properties(); /** * Gets the extendedLocation property: The extended location. - * + * * @return the extendedLocation value. */ ExtendedLocation extendedLocation(); /** - * Gets the credentials property: Credentials to connect to VMMServer. - * - * @return the credentials value. - */ - VmmServerPropertiesCredentials credentials(); - - /** - * Gets the fqdn property: Fqdn is the hostname/ip of the vmmServer. - * - * @return the fqdn value. - */ - String fqdn(); - - /** - * Gets the port property: Port is the port on which the vmmServer is listening. - * - * @return the port value. - */ - Integer port(); - - /** - * Gets the connectionStatus property: Gets or sets the connection status to the vmmServer. - * - * @return the connectionStatus value. - */ - String connectionStatus(); - - /** - * Gets the errorMessage property: Gets or sets any error message if connection to vmmServer is having any issue. - * - * @return the errorMessage value. - */ - String errorMessage(); - - /** - * Gets the uuid property: Unique ID of vmmServer. - * - * @return the uuid value. - */ - String uuid(); - - /** - * Gets the version property: Version is the version of the vmmSever. - * - * @return the version value. - */ - String version(); - - /** - * Gets the provisioningState property: Gets or sets the provisioning state. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String provisioningState(); + SystemData systemData(); /** * 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.scvmm.fluent.models.VmmServerInner object. - * + * * @return the inner object. */ VmmServerInner innerModel(); - /** The entirety of the VmmServer definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithExtendedLocation, - DefinitionStages.WithFqdn, - DefinitionStages.WithCreate { + /** + * The entirety of the VmmServer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCreate { } - /** The VmmServer definition stages. */ + + /** + * The VmmServer definition stages. + */ interface DefinitionStages { - /** The first stage of the VmmServer definition. */ + /** + * The first stage of the VmmServer definition. + */ interface Blank extends WithLocation { } - /** The stage of the VmmServer definition allowing to specify location. */ + + /** + * The stage of the VmmServer 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. */ @@ -164,141 +129,142 @@ 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 VmmServer definition allowing to specify parent resource. */ + + /** + * The stage of the VmmServer definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. + * + * @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 VmmServer definition allowing to specify extendedLocation. */ + + /** + * The stage of the VmmServer definition allowing to specify extendedLocation. + */ interface WithExtendedLocation { /** * Specifies the extendedLocation property: The extended location.. - * + * * @param extendedLocation The extended location. * @return the next definition stage. */ - WithFqdn withExtendedLocation(ExtendedLocation extendedLocation); - } - /** The stage of the VmmServer definition allowing to specify fqdn. */ - interface WithFqdn { - /** - * Specifies the fqdn property: Fqdn is the hostname/ip of the vmmServer.. - * - * @param fqdn Fqdn is the hostname/ip of the vmmServer. - * @return the next definition stage. - */ - WithCreate withFqdn(String fqdn); + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); } + /** * The stage of the VmmServer 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.WithCredentials, DefinitionStages.WithPort { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ VmmServer create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ VmmServer create(Context context); } - /** The stage of the VmmServer definition allowing to specify tags. */ + + /** + * The stage of the VmmServer 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 VmmServer definition allowing to specify credentials. */ - interface WithCredentials { - /** - * Specifies the credentials property: Credentials to connect to VMMServer.. - * - * @param credentials Credentials to connect to VMMServer. - * @return the next definition stage. - */ - WithCreate withCredentials(VmmServerPropertiesCredentials credentials); - } - /** The stage of the VmmServer definition allowing to specify port. */ - interface WithPort { + + /** + * The stage of the VmmServer definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the port property: Port is the port on which the vmmServer is listening.. - * - * @param port Port is the port on which the vmmServer is listening. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withPort(Integer port); + WithCreate withProperties(VmmServerProperties properties); } } + /** * Begins update for the VmmServer resource. - * + * * @return the stage of resource update. */ VmmServer.Update update(); - /** The template for VmmServer update. */ + /** + * The template for VmmServer update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ VmmServer apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ VmmServer apply(Context context); } - /** The VmmServer update stages. */ + + /** + * The VmmServer update stages. + */ interface UpdateStages { - /** The stage of the VmmServer update allowing to specify tags. */ + /** + * The stage of the VmmServer update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ VmmServer 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/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerListResult.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerListResult.java index 00c63a30b8c97..46a6bff72b8d3 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerListResult.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerListResult.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.scvmm.fluent.models.VmmServerInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of VmmServers. */ +/** + * The response of a VmmServer list operation. + */ @Fluent public final class VmmServerListResult { /* - * List of VmmServers. + * The VmmServer items on this page */ - @JsonProperty(value = "value") + @JsonProperty(value = "value", required = true) private List value; /* - * Url to follow for getting next page of resources. + * The link to the next page of items */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: List of VmmServers. - * + * Creates an instance of VmmServerListResult class. + */ + public VmmServerListResult() { + } + + /** + * Get the value property: The VmmServer items on this page. + * * @return the value value. */ public List value() { @@ -34,8 +43,8 @@ public List value() { } /** - * Set the value property: List of VmmServers. - * + * Set the value property: The VmmServer items on this page. + * * @param value the value value to set. * @return the VmmServerListResult object itself. */ @@ -45,8 +54,8 @@ public VmmServerListResult withValue(List value) { } /** - * Get the nextLink property: Url to follow for getting next page of resources. - * + * Get the nextLink property: The link to the next page of items. + * * @return the nextLink value. */ public String nextLink() { @@ -54,8 +63,8 @@ public String nextLink() { } /** - * Set the nextLink property: Url to follow for getting next page of resources. - * + * Set the nextLink property: The link to the next page of items. + * * @param nextLink the nextLink value to set. * @return the VmmServerListResult object itself. */ @@ -66,12 +75,17 @@ public VmmServerListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model VmmServerListResult")); + } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(VmmServerListResult.class); } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmmServerProperties.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerProperties.java similarity index 75% rename from sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmmServerProperties.java rename to sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerProperties.java index 704610ebb9acc..28fe450d9d648 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/fluent/models/VmmServerProperties.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerProperties.java @@ -2,21 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.scvmm.fluent.models; +package com.azure.resourcemanager.scvmm.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.scvmm.models.VmmServerPropertiesCredentials; import com.fasterxml.jackson.annotation.JsonProperty; -/** Defines the resource properties. */ +/** + * Defines the resource properties. + */ @Fluent public final class VmmServerProperties { /* - * Credentials to connect to VMMServer. + * Credentials to connect to VmmServer. */ @JsonProperty(value = "credentials") - private VmmServerPropertiesCredentials credentials; + private VmmCredential credentials; /* * Fqdn is the hostname/ip of the vmmServer. @@ -31,14 +32,13 @@ public final class VmmServerProperties { private Integer port; /* - * Gets or sets the connection status to the vmmServer. + * Gets the connection status to the vmmServer. */ @JsonProperty(value = "connectionStatus", access = JsonProperty.Access.WRITE_ONLY) private String connectionStatus; /* - * Gets or sets any error message if connection to vmmServer is having any - * issue. + * Gets any error message if connection to vmmServer is having any issue. */ @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) private String errorMessage; @@ -56,34 +56,40 @@ public final class VmmServerProperties { private String version; /* - * Gets or sets the provisioning state. + * Provisioning state of the resource. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; + private ProvisioningState provisioningState; /** - * Get the credentials property: Credentials to connect to VMMServer. - * + * Creates an instance of VmmServerProperties class. + */ + public VmmServerProperties() { + } + + /** + * Get the credentials property: Credentials to connect to VmmServer. + * * @return the credentials value. */ - public VmmServerPropertiesCredentials credentials() { + public VmmCredential credentials() { return this.credentials; } /** - * Set the credentials property: Credentials to connect to VMMServer. - * + * Set the credentials property: Credentials to connect to VmmServer. + * * @param credentials the credentials value to set. * @return the VmmServerProperties object itself. */ - public VmmServerProperties withCredentials(VmmServerPropertiesCredentials credentials) { + public VmmServerProperties withCredentials(VmmCredential credentials) { this.credentials = credentials; return this; } /** * Get the fqdn property: Fqdn is the hostname/ip of the vmmServer. - * + * * @return the fqdn value. */ public String fqdn() { @@ -92,7 +98,7 @@ public String fqdn() { /** * Set the fqdn property: Fqdn is the hostname/ip of the vmmServer. - * + * * @param fqdn the fqdn value to set. * @return the VmmServerProperties object itself. */ @@ -103,7 +109,7 @@ public VmmServerProperties withFqdn(String fqdn) { /** * Get the port property: Port is the port on which the vmmServer is listening. - * + * * @return the port value. */ public Integer port() { @@ -112,7 +118,7 @@ public Integer port() { /** * Set the port property: Port is the port on which the vmmServer is listening. - * + * * @param port the port value to set. * @return the VmmServerProperties object itself. */ @@ -122,8 +128,8 @@ public VmmServerProperties withPort(Integer port) { } /** - * Get the connectionStatus property: Gets or sets the connection status to the vmmServer. - * + * Get the connectionStatus property: Gets the connection status to the vmmServer. + * * @return the connectionStatus value. */ public String connectionStatus() { @@ -131,8 +137,8 @@ public String connectionStatus() { } /** - * Get the errorMessage property: Gets or sets any error message if connection to vmmServer is having any issue. - * + * Get the errorMessage property: Gets any error message if connection to vmmServer is having any issue. + * * @return the errorMessage value. */ public String errorMessage() { @@ -141,7 +147,7 @@ public String errorMessage() { /** * Get the uuid property: Unique ID of vmmServer. - * + * * @return the uuid value. */ public String uuid() { @@ -150,7 +156,7 @@ public String uuid() { /** * Get the version property: Version is the version of the vmmSever. - * + * * @return the version value. */ public String version() { @@ -158,17 +164,17 @@ public String version() { } /** - * Get the provisioningState property: Gets or sets the provisioning state. - * + * Get the provisioningState property: Provisioning state of the resource. + * * @return the provisioningState value. */ - public String provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -176,9 +182,8 @@ public void validate() { credentials().validate(); } if (fqdn() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property fqdn in model VmmServerProperties")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property fqdn in model VmmServerProperties")); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerTagsUpdate.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerTagsUpdate.java new file mode 100644 index 0000000000000..1fc7dfa24f6d7 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServerTagsUpdate.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.scvmm.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The type used for updating tags in VmmServer resources. + */ +@Fluent +public final class VmmServerTagsUpdate { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Creates an instance of VmmServerTagsUpdate class. + */ + public VmmServerTagsUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VmmServerTagsUpdate object itself. + */ + public VmmServerTagsUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServers.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServers.java index 4221e56b68eef..3a24d3bec353e 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServers.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/VmmServers.java @@ -8,117 +8,105 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of VmmServers. */ +/** + * Resource collection API of VmmServers. + */ public interface VmmServers { /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * List of VmmServers in a 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 the VmmServers resource definition. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - VmmServer getByResourceGroup(String resourceGroupName, String vmmServerName); + PagedIterable list(); /** - * Implements VMMServer GET method. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * List of VmmServers in a 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 the VmmServers resource definition along with {@link Response}. + * @return the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String vmmServerName, Context context); + PagedIterable list(Context context); /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * List of VmmServers in a 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 the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String vmmServerName, Boolean force); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. + * List of VmmServers in a 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 the response of a VmmServer list operation as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String vmmServerName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deboards the SCVMM fabric from Azure. - * - * @param resourceGroupName The name of the resource group. - * @param vmmServerName Name of the VMMServer. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @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 VmmServers resource definition along with {@link Response}. */ - void delete(String resourceGroupName, String vmmServerName, Boolean force, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String vmmServerName, Context context); /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. + * Implements VmmServer GET method. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedIterable}. + * @return the VmmServers resource definition. */ - PagedIterable listByResourceGroup(String resourceGroupName); + VmmServer getByResourceGroup(String resourceGroupName, String vmmServerName); /** - * List of VmmServers in a resource group. - * - * @param resourceGroupName The name of the resource group. - * @param context The context to associate with this operation. + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of VmmServers as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List of VmmServers in a 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 list of VmmServers as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + void delete(String resourceGroupName, String vmmServerName); /** - * List of VmmServers in a subscription. - * + * Removes the SCVmm fabric from Azure. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmmServerName Name of the VmmServer. + * @param force Forces the resource to be deleted. * @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 list of VmmServers as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + void delete(String resourceGroupName, String vmmServerName, Boolean force, Context context); /** - * Implements VMMServer GET method. - * + * Implements VmmServer GET method. + * * @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. @@ -128,8 +116,8 @@ public interface VmmServers { VmmServer getById(String id); /** - * Implements VMMServer GET method. - * + * Implements VmmServer GET method. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,8 +128,8 @@ public interface VmmServers { Response getByIdWithResponse(String id, Context context); /** - * Deboards the SCVMM fabric from Azure. - * + * Removes the SCVmm fabric from Azure. + * * @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. @@ -150,11 +138,10 @@ public interface VmmServers { void deleteById(String id); /** - * Deboards the SCVMM fabric from Azure. - * + * Removes the SCVmm fabric from Azure. + * * @param id the resource ID. - * @param force Forces the resource to be deleted from azure. The corresponding CR would be attempted to be deleted - * too. + * @param force Forces the resource to be deleted. * @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. @@ -164,7 +151,7 @@ public interface VmmServers { /** * Begins definition for a new VmmServer resource. - * + * * @param name resource name. * @return the first stage of the new VmmServer definition. */ diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/package-info.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/package-info.java index 369408205b461..f84b6a59a77d2 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/package-info.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for ScvmmClient. SCVMM Client. */ +/** + * Package containing the data models for ScvmmClient. + * SCVMM Client. + */ package com.azure.resourcemanager.scvmm.models; diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/package-info.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/package-info.java index 11ebca94ed958..324adf22d7f1e 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/package-info.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/com/azure/resourcemanager/scvmm/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for ScvmmClient. SCVMM Client. */ +/** + * Package containing the classes for ScvmmClient. + * SCVMM Client. + */ package com.azure.resourcemanager.scvmm; diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/module-info.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/module-info.java index 7c61b963233e8..714656dd4e5de 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/module-info.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/java/module-info.java @@ -10,10 +10,6 @@ exports com.azure.resourcemanager.scvmm.fluent.models; exports com.azure.resourcemanager.scvmm.models; - opens com.azure.resourcemanager.scvmm.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.scvmm.models to - com.azure.core, - com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.scvmm.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.scvmm.models to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-scvmm/proxy-config.json b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-scvmm/proxy-config.json new file mode 100644 index 0000000000000..de66c263d7cc0 --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-scvmm/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.scvmm.implementation.VirtualMachineInstancesClientImpl$VirtualMachineInstancesService" ], [ "com.azure.resourcemanager.scvmm.implementation.GuestAgentsClientImpl$GuestAgentsService" ], [ "com.azure.resourcemanager.scvmm.implementation.VmInstanceHybridIdentityMetadatasClientImpl$VmInstanceHybridIdentityMetadatasService" ], [ "com.azure.resourcemanager.scvmm.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.scvmm.implementation.AvailabilitySetsClientImpl$AvailabilitySetsService" ], [ "com.azure.resourcemanager.scvmm.implementation.CloudsClientImpl$CloudsService" ], [ "com.azure.resourcemanager.scvmm.implementation.VirtualMachineTemplatesClientImpl$VirtualMachineTemplatesService" ], [ "com.azure.resourcemanager.scvmm.implementation.VirtualNetworksClientImpl$VirtualNetworksService" ], [ "com.azure.resourcemanager.scvmm.implementation.VmmServersClientImpl$VmmServersService" ], [ "com.azure.resourcemanager.scvmm.implementation.InventoryItemsClientImpl$InventoryItemsService" ] ] \ No newline at end of file diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-scvmm/reflect-config.json b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-scvmm/reflect-config.json new file mode 100644 index 0000000000000..49b0e078015ad --- /dev/null +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-scvmm/reflect-config.json @@ -0,0 +1,371 @@ +[ { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineInstanceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.AvailabilitySetListItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.OsProfileForVmInstance", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.HardwareProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.NetworkProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.NetworkInterface", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.StorageProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualDisk", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.StorageQosPolicyDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.InfrastructureProfile", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.Checkpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.ExtendedLocation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineInstanceUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.GuestAgentListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.GuestAgentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.GuestAgentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.GuestCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.HttpProxyConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadataListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.VmInstanceHybridIdentityMetadataInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VmInstanceHybridIdentityMetadataProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.AvailabilitySetListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.AvailabilitySetInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.AvailabilitySetProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.CloudListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.CloudInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.CloudProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.CloudCapacity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.StorageQosPolicy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.VirtualMachineTemplateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualNetworkListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.VirtualNetworkInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualNetworkProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VmmServerListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.VmmServerInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VmmServerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VmmCredential", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.AvailabilitySetTagsUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.CloudTagsUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateTagsUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualNetworkTagsUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VmmServerTagsUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.InventoryItemListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.fluent.models.InventoryItemInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.InventoryItemProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.CloudInventoryItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.InventoryItemDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineInventoryItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualMachineTemplateInventoryItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.VirtualNetworkInventoryItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.OsType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.LimitCpuForMigration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.DynamicMemoryEnabled", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.IsHighlyAvailable", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.AllocationMethod", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.CreateDiffDisk", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.ProvisioningAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.SkipShutdown", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.scvmm.models.IsCustomizable", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsCreateOrUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsCreateOrUpdateSamples.java deleted file mode 100644 index d5bdac68b9442..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsCreateOrUpdateSamples.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.scvmm.generated; - -import com.azure.resourcemanager.scvmm.models.ExtendedLocation; - -/** Samples for AvailabilitySets CreateOrUpdate. */ -public final class AvailabilitySetsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateAvailabilitySet.json - */ - /** - * Sample code: CreateAvailabilitySet. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createAvailabilitySet(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .availabilitySets() - .define("HRAvailabilitySet") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withAvailabilitySetName("hr-avset") - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ScVmm/VMMServers/ContosoVMMServer") - .create(); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsDeleteSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsDeleteSamples.java deleted file mode 100644 index dc103356c547c..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailabilitySets Delete. */ -public final class AvailabilitySetsDeleteSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteAvailabilitySet.json - */ - /** - * Sample code: DeleteAvailabilitySet. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteAvailabilitySet(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.availabilitySets().delete("testrg", "HRAvailabilitySet", null, Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsGetByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsGetByResourceGroupSamples.java deleted file mode 100644 index 6a2aa1689df39..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsGetByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailabilitySets GetByResourceGroup. */ -public final class AvailabilitySetsGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetAvailabilitySet.json - */ - /** - * Sample code: GetAvailabilitySet. - * - * @param manager Entry point to ScvmmManager. - */ - public static void getAvailabilitySet(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.availabilitySets().getByResourceGroupWithResponse("testrg", "HRAvailabilitySet", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsListByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsListByResourceGroupSamples.java deleted file mode 100644 index eb7804b03ef68..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsListByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailabilitySets ListByResourceGroup. */ -public final class AvailabilitySetsListByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListAvailabilitySetsByResourceGroup.json - */ - /** - * Sample code: ListAvailabilitySetsByResourceGroup. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listAvailabilitySetsByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.availabilitySets().listByResourceGroup("testrg", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsListSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsListSamples.java deleted file mode 100644 index 0bea664ec386c..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for AvailabilitySets List. */ -public final class AvailabilitySetsListSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListAvailabilitySetsBySubscription.json - */ - /** - * Sample code: ListAvailabilitySetsBySubscription. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listAvailabilitySetsBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.availabilitySets().list(Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsUpdateSamples.java deleted file mode 100644 index 231292ddfe5d0..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/AvailabilitySetsUpdateSamples.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.scvmm.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.AvailabilitySet; -import java.util.HashMap; -import java.util.Map; - -/** Samples for AvailabilitySets Update. */ -public final class AvailabilitySetsUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateAvailabilitySet.json - */ - /** - * Sample code: UpdateAvailabilitySet. - * - * @param manager Entry point to ScvmmManager. - */ - public static void updateAvailabilitySet(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - AvailabilitySet resource = - manager - .availabilitySets() - .getByResourceGroupWithResponse("testrg", "HRAvailabilitySet", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @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/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsCreateOrUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsCreateOrUpdateSamples.java index c7b02ce79c460..025c9e60a8c6e 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsCreateOrUpdateSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsCreateOrUpdateSamples.java @@ -6,30 +6,35 @@ import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -/** Samples for Clouds CreateOrUpdate. */ +/** + * Samples for Clouds CreateOrUpdate. + */ public final class CloudsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateCloud.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * Clouds_CreateOrUpdate_MinimumSet_Gen.json */ /** - * Sample code: CreateCloud. - * + * Sample code: CreateCloud - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void createCloud(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .clouds() - .define("HRCloud") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withUuid("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer") - .create(); + public static void createCloudGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().define("_").withRegion((String) null).withExistingResourceGroup("rgscvmm") + .withExtendedLocation((ExtendedLocation) null).create(); + } + + /* + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * Clouds_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: CreateCloud - generated by [MaximumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void createCloudGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().define("-").withRegion((String) null).withExistingResourceGroup("rgscvmm") + .withExtendedLocation((ExtendedLocation) null).create(); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsDeleteSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsDeleteSamples.java index 506afbb4b0008..26cbfac1ddbee 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsDeleteSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsDeleteSamples.java @@ -4,19 +4,33 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for Clouds Delete. */ +/** + * Samples for Clouds Delete. + */ public final class CloudsDeleteSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteCloud.json + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: DeleteCloud - generated by [MinimumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void deleteCloudGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().delete("rgscvmm", ".", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json */ /** - * Sample code: DeleteCloud. - * + * Sample code: DeleteCloud - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void deleteCloud(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.clouds().delete("testrg", "HRCloud", null, Context.NONE); + public static void deleteCloudGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().delete("rgscvmm", "2", false, com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsGetByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsGetByResourceGroupSamples.java index ff6eb4040f53b..741d4e1f667c8 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsGetByResourceGroupSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsGetByResourceGroupSamples.java @@ -4,19 +4,33 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for Clouds GetByResourceGroup. */ +/** + * Samples for Clouds GetByResourceGroup. + */ public final class CloudsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetCloud.json + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json + */ + /** + * Sample code: GetCloud - generated by [MaximumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void getCloudGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().getByResourceGroupWithResponse("rgscvmm", ".", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MinimumSet_Gen.json */ /** - * Sample code: GetCloud. - * + * Sample code: GetCloud - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void getCloud(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.clouds().getByResourceGroupWithResponse("testrg", "HRCloud", Context.NONE); + public static void getCloudGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().getByResourceGroupWithResponse("rgscvmm", ".", com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsListByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsListByResourceGroupSamples.java index 32ca1c420e7b9..ec6f793353ca6 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsListByResourceGroupSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsListByResourceGroupSamples.java @@ -4,19 +4,35 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for Clouds ListByResourceGroup. */ +/** + * Samples for Clouds ListByResourceGroup. + */ public final class CloudsListByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListCloudsByResourceGroup.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * Clouds_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: ListCloudsByResourceGroup - generated by [MinimumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void + listCloudsByResourceGroupGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().listByResourceGroup("rgscvmm", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * Clouds_ListByResourceGroup_MaximumSet_Gen.json */ /** - * Sample code: ListCloudsByResourceGroup. - * + * Sample code: ListCloudsByResourceGroup - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listCloudsByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.clouds().listByResourceGroup("testrg", Context.NONE); + public static void + listCloudsByResourceGroupGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().listByResourceGroup("rgscvmm", com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsListSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsListSamples.java index 7e76466908e1a..f65181e355ea8 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsListSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsListSamples.java @@ -4,19 +4,35 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for Clouds List. */ +/** + * Samples for Clouds List. + */ public final class CloudsListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListCloudsBySubscription.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * Clouds_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: ListCloudsBySubscription - generated by [MinimumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void + listCloudsBySubscriptionGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * Clouds_ListBySubscription_MaximumSet_Gen.json */ /** - * Sample code: ListCloudsBySubscription. - * + * Sample code: ListCloudsBySubscription - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listCloudsBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.clouds().list(Context.NONE); + public static void + listCloudsBySubscriptionGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.clouds().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsUpdateSamples.java index 8e6a6709d356f..da2a53a9637e1 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsUpdateSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/CloudsUpdateSamples.java @@ -4,34 +4,39 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.models.Cloud; -import java.util.HashMap; -import java.util.Map; -/** Samples for Clouds Update. */ +/** + * Samples for Clouds Update. + */ public final class CloudsUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateCloud.json + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json */ /** - * Sample code: UpdateCloud. - * + * Sample code: UpdateCloud - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void updateCloud(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - Cloud resource = manager.clouds().getByResourceGroupWithResponse("testrg", "HRCloud", Context.NONE).getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + public static void updateCloudGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + Cloud resource = manager.clouds() + .getByResourceGroupWithResponse("rgscvmm", "b", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); } - @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; + /* + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MinimumSet_Gen.json + */ + /** + * Sample code: UpdateCloud - generated by [MinimumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void updateCloudGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + Cloud resource = manager.clouds() + .getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsCreateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsCreateSamples.java deleted file mode 100644 index ef44c7251ebcb..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsCreateSamples.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.scvmm.generated; - -/** Samples for InventoryItems Create. */ -public final class InventoryItemsCreateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateInventoryItem.json - */ - /** - * Sample code: CreateInventoryItem. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createInventoryItem(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .inventoryItems() - .define("12345678-1234-1234-1234-123456789abc") - .withExistingVmmServer("testrg", "ContosoVMMServer") - .create(); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsDeleteSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsDeleteSamples.java deleted file mode 100644 index b0ca629e3173c..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsDeleteSamples.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.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for InventoryItems Delete. */ -public final class InventoryItemsDeleteSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteInventoryItem.json - */ - /** - * Sample code: DeleteInventoryItem. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteInventoryItem(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .inventoryItems() - .deleteWithResponse("testrg", "ContosoVMMServer", "12345678-1234-1234-1234-123456789abc", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsGetSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsGetSamples.java deleted file mode 100644 index b57ed51d08bf7..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsGetSamples.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.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for InventoryItems Get. */ -public final class InventoryItemsGetSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetInventoryItem.json - */ - /** - * Sample code: GetInventoryItem. - * - * @param manager Entry point to ScvmmManager. - */ - public static void getInventoryItem(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .inventoryItems() - .getWithResponse("testrg", "ContosoVMMServer", "12345678-1234-1234-1234-123456789abc", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsListByVmmServerSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsListByVmmServerSamples.java deleted file mode 100644 index e1aa3ccb1d780..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/InventoryItemsListByVmmServerSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for InventoryItems ListByVmmServer. */ -public final class InventoryItemsListByVmmServerSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListInventoryItemsByVMMServer.json - */ - /** - * Sample code: InventoryItemsListByVMMServer. - * - * @param manager Entry point to ScvmmManager. - */ - public static void inventoryItemsListByVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.inventoryItems().listByVmmServer("testrg", "ContosoVMMServer", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/OperationsListSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/OperationsListSamples.java index 65cc00aae34cd..27ff3e6c9b3ff 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/OperationsListSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/OperationsListSamples.java @@ -4,19 +4,35 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListOperations.json + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MinimumSet_Gen. + * json + */ + /** + * Sample code: ListOperations - generated by [MinimumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void listOperationsGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen. + * json */ /** - * Sample code: ListOperations. - * + * Sample code: ListOperations - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listOperations(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.operations().list(Context.NONE); + public static void listOperationsGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesCreateOrUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesCreateOrUpdateSamples.java deleted file mode 100644 index 1522f3f1c3245..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesCreateOrUpdateSamples.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.scvmm.generated; - -import com.azure.resourcemanager.scvmm.models.ExtendedLocation; - -/** Samples for VirtualMachineTemplates CreateOrUpdate. */ -public final class VirtualMachineTemplatesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualMachineTemplate.json - */ - /** - * Sample code: CreateVirtualMachineTemplate. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachineTemplates() - .define("HRVirtualMachineTemplate") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withUuid("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer") - .create(); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesDeleteSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesDeleteSamples.java deleted file mode 100644 index 132c6732c494b..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates Delete. */ -public final class VirtualMachineTemplatesDeleteSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualMachineTemplate.json - */ - /** - * Sample code: DeleteVirtualMachineTemplate. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachineTemplates().delete("testrg", "HRVirtualMachineTemplate", null, Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesGetByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesGetByResourceGroupSamples.java deleted file mode 100644 index 40eb29ffef264..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesGetByResourceGroupSamples.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.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates GetByResourceGroup. */ -public final class VirtualMachineTemplatesGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualMachineTemplate.json - */ - /** - * Sample code: GetVirtualMachineTemplate. - * - * @param manager Entry point to ScvmmManager. - */ - public static void getVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachineTemplates() - .getByResourceGroupWithResponse("testrg", "HRVirtualMachineTemplate", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesListByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesListByResourceGroupSamples.java deleted file mode 100644 index 9ed59c28f8a36..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesListByResourceGroupSamples.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.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates ListByResourceGroup. */ -public final class VirtualMachineTemplatesListByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachineTemplatesByResourceGroup.json - */ - /** - * Sample code: ListVirtualMachineTemplatesByResourceGroup. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualMachineTemplatesByResourceGroup( - com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachineTemplates().listByResourceGroup("testrg", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesListSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesListSamples.java deleted file mode 100644 index 96e8445890082..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachineTemplates List. */ -public final class VirtualMachineTemplatesListSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachineTemplatesBySubscription.json - */ - /** - * Sample code: ListVirtualMachineTemplatesBySubscription. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualMachineTemplatesBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachineTemplates().list(Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesUpdateSamples.java deleted file mode 100644 index 2b4642f6a7c49..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachineTemplatesUpdateSamples.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.scvmm.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualMachineTemplate; -import java.util.HashMap; -import java.util.Map; - -/** Samples for VirtualMachineTemplates Update. */ -public final class VirtualMachineTemplatesUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualMachineTemplate.json - */ - /** - * Sample code: UpdateVirtualMachineTemplate. - * - * @param manager Entry point to ScvmmManager. - */ - public static void updateVirtualMachineTemplate(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - VirtualMachineTemplate resource = - manager - .virtualMachineTemplates() - .getByResourceGroupWithResponse("testrg", "HRVirtualMachineTemplate", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @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/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesCreateCheckpointSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesCreateCheckpointSamples.java deleted file mode 100644 index 2bfa176dfd3e3..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesCreateCheckpointSamples.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.scvmm.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualMachineCreateCheckpoint; - -/** Samples for VirtualMachines CreateCheckpoint. */ -public final class VirtualMachinesCreateCheckpointSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateCheckpointVirtualMachine.json - */ - /** - * Sample code: CreateCheckpointVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createCheckpointVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .createCheckpoint( - "testrg", - "DemoVM", - new VirtualMachineCreateCheckpoint() - .withName("Demo Checkpoint name") - .withDescription("Demo Checkpoint description"), - Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesCreateOrUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesCreateOrUpdateSamples.java deleted file mode 100644 index 44437779ba4cd..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesCreateOrUpdateSamples.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.scvmm.generated; - -import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.HardwareProfile; - -/** Samples for VirtualMachines CreateOrUpdate. */ -public final class VirtualMachinesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualMachine.json - */ - /** - * Sample code: CreateVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void createVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .define("DemoVM") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer") - .withCloudId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud") - .withTemplateId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate") - .withHardwareProfile(new HardwareProfile().withMemoryMB(4096).withCpuCount(4)) - .create(); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesDeleteCheckpointSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesDeleteCheckpointSamples.java deleted file mode 100644 index 4cb530f986069..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesDeleteCheckpointSamples.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.scvmm.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualMachineDeleteCheckpoint; - -/** Samples for VirtualMachines DeleteCheckpoint. */ -public final class VirtualMachinesDeleteCheckpointSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteCheckpointVirtualMachine.json - */ - /** - * Sample code: DeleteCheckpointVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteCheckpointVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .deleteCheckpoint( - "testrg", "DemoVM", new VirtualMachineDeleteCheckpoint().withId("Demo CheckpointID"), Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesDeleteSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesDeleteSamples.java deleted file mode 100644 index 540e243db908b..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Delete. */ -public final class VirtualMachinesDeleteSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualMachine.json - */ - /** - * Sample code: DeleteVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().delete("testrg", "DemoVM", null, null, Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesGetByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesGetByResourceGroupSamples.java deleted file mode 100644 index 8cf7ec5e84d97..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesGetByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines GetByResourceGroup. */ -public final class VirtualMachinesGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualMachine.json - */ - /** - * Sample code: GetVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void getVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().getByResourceGroupWithResponse("testrg", "DemoVM", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesListByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesListByResourceGroupSamples.java deleted file mode 100644 index a922514c1544b..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesListByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines ListByResourceGroup. */ -public final class VirtualMachinesListByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachinesByResourceGroup.json - */ - /** - * Sample code: ListVirtualMachinesByResourceGroup. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualMachinesByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().listByResourceGroup("testrg", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesListSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesListSamples.java deleted file mode 100644 index a52ffb96093a1..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines List. */ -public final class VirtualMachinesListSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualMachinesBySubscription.json - */ - /** - * Sample code: ListVirtualMachinesBySubscription. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualMachinesBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().list(Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesRestartSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesRestartSamples.java deleted file mode 100644 index 35c095e9d962d..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesRestartSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Restart. */ -public final class VirtualMachinesRestartSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/RestartVirtualMachine.json - */ - /** - * Sample code: RestartVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void restartVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().restart("testrg", "DemoVM", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesRestoreCheckpointSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesRestoreCheckpointSamples.java deleted file mode 100644 index 0c35d2d2e75b0..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesRestoreCheckpointSamples.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.scvmm.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualMachineRestoreCheckpoint; - -/** Samples for VirtualMachines RestoreCheckpoint. */ -public final class VirtualMachinesRestoreCheckpointSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/RestoreCheckpointVirtualMachine.json - */ - /** - * Sample code: RestoreCheckpointVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void restoreCheckpointVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .restoreCheckpoint( - "testrg", "DemoVM", new VirtualMachineRestoreCheckpoint().withId("Demo CheckpointID"), Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesStartSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesStartSamples.java deleted file mode 100644 index 0f1755f6fbd30..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesStartSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualMachines Start. */ -public final class VirtualMachinesStartSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/StartVirtualMachine.json - */ - /** - * Sample code: StartVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void startVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualMachines().start("testrg", "DemoVM", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesStopSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesStopSamples.java deleted file mode 100644 index 624c64247cd37..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesStopSamples.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.scvmm.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.StopVirtualMachineOptions; - -/** Samples for VirtualMachines Stop. */ -public final class VirtualMachinesStopSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/StopVirtualMachine.json - */ - /** - * Sample code: StopVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void stopVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualMachines() - .stop("testrg", "DemoVM", new StopVirtualMachineOptions().withSkipShutdown(true), Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesUpdateSamples.java deleted file mode 100644 index 7fa16fd3d3126..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualMachinesUpdateSamples.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.scvmm.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.AllocationMethod; -import com.azure.resourcemanager.scvmm.models.HardwareProfileUpdate; -import com.azure.resourcemanager.scvmm.models.NetworkInterfacesUpdate; -import com.azure.resourcemanager.scvmm.models.NetworkProfileUpdate; -import com.azure.resourcemanager.scvmm.models.StorageProfileUpdate; -import com.azure.resourcemanager.scvmm.models.VirtualDiskUpdate; -import com.azure.resourcemanager.scvmm.models.VirtualMachine; -import com.azure.resourcemanager.scvmm.models.VirtualMachineUpdateProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for VirtualMachines Update. */ -public final class VirtualMachinesUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualMachine.json - */ - /** - * Sample code: UpdateVirtualMachine. - * - * @param manager Entry point to ScvmmManager. - */ - public static void updateVirtualMachine(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - VirtualMachine resource = - manager.virtualMachines().getByResourceGroupWithResponse("testrg", "DemoVM", Context.NONE).getValue(); - resource - .update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withProperties( - new VirtualMachineUpdateProperties() - .withHardwareProfile(new HardwareProfileUpdate().withMemoryMB(4096).withCpuCount(4)) - .withStorageProfile( - new StorageProfileUpdate() - .withDisks(Arrays.asList(new VirtualDiskUpdate().withName("test").withDiskSizeGB(10)))) - .withNetworkProfile( - new NetworkProfileUpdate() - .withNetworkInterfaces( - Arrays - .asList( - new NetworkInterfacesUpdate() - .withName("test") - .withIpv4AddressType(AllocationMethod.DYNAMIC) - .withIpv6AddressType(AllocationMethod.DYNAMIC) - .withMacAddressType(AllocationMethod.STATIC))))) - .apply(); - } - - @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/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksCreateOrUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksCreateOrUpdateSamples.java index a61025cc0d564..bfad9acd55192 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksCreateOrUpdateSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksCreateOrUpdateSamples.java @@ -6,30 +6,22 @@ import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -/** Samples for VirtualNetworks CreateOrUpdate. */ +/** + * Samples for VirtualNetworks CreateOrUpdate. + */ public final class VirtualNetworksCreateOrUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVirtualNetwork.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json */ /** - * Sample code: CreateVirtualNetwork. - * + * Sample code: CreateVirtualNetwork - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void createVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .virtualNetworks() - .define("HRVirtualNetwork") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withUuid("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") - .withVmmServerId( - "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer") - .create(); + public static void + createVirtualNetworkGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.virtualNetworks().define("j").withRegion((String) null).withExistingResourceGroup("rgscvmm") + .withExtendedLocation((ExtendedLocation) null).create(); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksDeleteSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksDeleteSamples.java deleted file mode 100644 index 9225f89573226..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualNetworks Delete. */ -public final class VirtualNetworksDeleteSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVirtualNetwork.json - */ - /** - * Sample code: DeleteVirtualNetwork. - * - * @param manager Entry point to ScvmmManager. - */ - public static void deleteVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualNetworks().delete("testrg", "HRVirtualNetwork", null, Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksGetByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksGetByResourceGroupSamples.java index 7afaf26c5de68..a52d6d963cfec 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksGetByResourceGroupSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksGetByResourceGroupSamples.java @@ -4,19 +4,35 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for VirtualNetworks GetByResourceGroup. */ +/** + * Samples for VirtualNetworks GetByResourceGroup. + */ public final class VirtualNetworksGetByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVirtualNetwork.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VirtualNetworks_Get_MaximumSet_Gen.json + */ + /** + * Sample code: GetVirtualNetwork - generated by [MaximumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void + getVirtualNetworkGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.virtualNetworks().getByResourceGroupWithResponse("rgscvmm", "s", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VirtualNetworks_Get_MinimumSet_Gen.json */ /** - * Sample code: GetVirtualNetwork. - * + * Sample code: GetVirtualNetwork - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void getVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualNetworks().getByResourceGroupWithResponse("testrg", "HRVirtualNetwork", Context.NONE); + public static void + getVirtualNetworkGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.virtualNetworks().getByResourceGroupWithResponse("rgscvmm", "_", com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksListByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksListByResourceGroupSamples.java deleted file mode 100644 index fcd09724fc32b..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksListByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualNetworks ListByResourceGroup. */ -public final class VirtualNetworksListByResourceGroupSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualNetworksByResourceGroup.json - */ - /** - * Sample code: ListVirtualNetworksByResourceGroup. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualNetworksByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualNetworks().listByResourceGroup("testrg", Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksListSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksListSamples.java deleted file mode 100644 index c21217a44daf7..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.scvmm.generated; - -import com.azure.core.util.Context; - -/** Samples for VirtualNetworks List. */ -public final class VirtualNetworksListSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVirtualNetworksBySubscription.json - */ - /** - * Sample code: ListVirtualNetworksBySubscription. - * - * @param manager Entry point to ScvmmManager. - */ - public static void listVirtualNetworksBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.virtualNetworks().list(Context.NONE); - } -} diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksUpdateSamples.java deleted file mode 100644 index 49b5f8e580c6d..0000000000000 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VirtualNetworksUpdateSamples.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.scvmm.generated; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.scvmm.models.VirtualNetwork; -import java.util.HashMap; -import java.util.Map; - -/** Samples for VirtualNetworks Update. */ -public final class VirtualNetworksUpdateSamples { - /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVirtualNetwork.json - */ - /** - * Sample code: UpdateVirtualNetwork. - * - * @param manager Entry point to ScvmmManager. - */ - public static void updateVirtualNetwork(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - VirtualNetwork resource = - manager - .virtualNetworks() - .getByResourceGroupWithResponse("testrg", "HRVirtualNetwork", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - @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/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersCreateOrUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersCreateOrUpdateSamples.java index 96700ee58fd0b..d85aefc334db4 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersCreateOrUpdateSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersCreateOrUpdateSamples.java @@ -5,32 +5,36 @@ package com.azure.resourcemanager.scvmm.generated; import com.azure.resourcemanager.scvmm.models.ExtendedLocation; -import com.azure.resourcemanager.scvmm.models.VmmServerPropertiesCredentials; -/** Samples for VmmServers CreateOrUpdate. */ +/** + * Samples for VmmServers CreateOrUpdate. + */ public final class VmmServersCreateOrUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/CreateVMMServer.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VmmServers_CreateOrUpdate_MinimumSet_Gen.json */ /** - * Sample code: CreateVMMServer. - * + * Sample code: CreateVMMServer - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void createVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager - .vmmServers() - .define("ContosoVMMServer") - .withRegion("East US") - .withExistingResourceGroup("testrg") - .withExtendedLocation( - new ExtendedLocation() - .withType("customLocation") - .withName( - "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")) - .withFqdn("VMM.contoso.com") - .withCredentials(new VmmServerPropertiesCredentials().withUsername("testuser").withPassword("password")) - .withPort(1234) - .create(); + public static void createVMMServerGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().define("h").withRegion((String) null).withExistingResourceGroup("rgscvmm") + .withExtendedLocation((ExtendedLocation) null).create(); + } + + /* + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VmmServers_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: CreateVMMServer - generated by [MaximumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void createVMMServerGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().define("b").withRegion((String) null).withExistingResourceGroup("rgscvmm") + .withExtendedLocation((ExtendedLocation) null).create(); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersDeleteSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersDeleteSamples.java index b81f2897402c0..3dc2a19192bba 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersDeleteSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersDeleteSamples.java @@ -4,19 +4,35 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for VmmServers Delete. */ +/** + * Samples for VmmServers Delete. + */ public final class VmmServersDeleteSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/DeleteVMMServer.json + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen. + * json + */ + /** + * Sample code: DeleteVMMServer - generated by [MaximumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void deleteVMMServerGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().delete("rgscvmm", "-", false, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MinimumSet_Gen. + * json */ /** - * Sample code: DeleteVMMServer. - * + * Sample code: DeleteVMMServer - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void deleteVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.vmmServers().delete("testrg", "ContosoVMMServer", null, Context.NONE); + public static void deleteVMMServerGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().delete("rgscvmm", "-", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersGetByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersGetByResourceGroupSamples.java index f2a411762b3df..544cf876a0e4d 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersGetByResourceGroupSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersGetByResourceGroupSamples.java @@ -4,19 +4,35 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for VmmServers GetByResourceGroup. */ +/** + * Samples for VmmServers GetByResourceGroup. + */ public final class VmmServersGetByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/GetVMMServer.json + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MinimumSet_Gen. + * json + */ + /** + * Sample code: GetVMMServer - generated by [MinimumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void getVMMServerGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen. + * json */ /** - * Sample code: GetVMMServer. - * + * Sample code: GetVMMServer - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void getVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.vmmServers().getByResourceGroupWithResponse("testrg", "ContosoVMMServer", Context.NONE); + public static void getVMMServerGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersListByResourceGroupSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersListByResourceGroupSamples.java index bd4607ef1ea92..6c86970895857 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersListByResourceGroupSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersListByResourceGroupSamples.java @@ -4,19 +4,35 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for VmmServers ListByResourceGroup. */ +/** + * Samples for VmmServers ListByResourceGroup. + */ public final class VmmServersListByResourceGroupSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVMMServersByResourceGroup.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VmmServers_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: ListVmmServersByResourceGroup - generated by [MaximumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void + listVmmServersByResourceGroupGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().listByResourceGroup("rgscvmm", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VmmServers_ListByResourceGroup_MinimumSet_Gen.json */ /** - * Sample code: ListVmmServersByResourceGroup. - * + * Sample code: ListVmmServersByResourceGroup - generated by [MinimumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listVmmServersByResourceGroup(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.vmmServers().listByResourceGroup("testrg", Context.NONE); + public static void + listVmmServersByResourceGroupGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().listByResourceGroup("rgscvmm", com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersListSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersListSamples.java index d10eabbf6d536..a9d73da841a7a 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersListSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersListSamples.java @@ -4,19 +4,35 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; - -/** Samples for VmmServers List. */ +/** + * Samples for VmmServers List. + */ public final class VmmServersListSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/ListVMMServersBySubscription.json + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VmmServers_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: ListVmmServersBySubscription - generated by [MinimumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void + listVmmServersBySubscriptionGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/ + * VmmServers_ListBySubscription_MaximumSet_Gen.json */ /** - * Sample code: ListVmmServersBySubscription. - * + * Sample code: ListVmmServersBySubscription - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void listVmmServersBySubscription(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - manager.vmmServers().list(Context.NONE); + public static void + listVmmServersBySubscriptionGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + manager.vmmServers().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersUpdateSamples.java b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersUpdateSamples.java index 9c3390e5c6e12..2ac92dbb03d04 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersUpdateSamples.java +++ b/sdk/scvmm/azure-resourcemanager-scvmm/src/samples/java/com/azure/resourcemanager/scvmm/generated/VmmServersUpdateSamples.java @@ -4,35 +4,41 @@ package com.azure.resourcemanager.scvmm.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.scvmm.models.VmmServer; -import java.util.HashMap; -import java.util.Map; -/** Samples for VmmServers Update. */ +/** + * Samples for VmmServers Update. + */ public final class VmmServersUpdateSamples { /* - * x-ms-original-file: specification/scvmm/resource-manager/Microsoft.ScVmm/preview/2020-06-05-preview/examples/UpdateVMMServer.json + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen. + * json */ /** - * Sample code: UpdateVMMServer. - * + * Sample code: UpdateVMMServer - generated by [MaximumSet] rule. + * * @param manager Entry point to ScvmmManager. */ - public static void updateVMMServer(com.azure.resourcemanager.scvmm.ScvmmManager manager) { - VmmServer resource = - manager.vmmServers().getByResourceGroupWithResponse("testrg", "ContosoVMMServer", Context.NONE).getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + public static void updateVMMServerGeneratedByMaximumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + VmmServer resource = manager.vmmServers() + .getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); } - @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; + /* + * x-ms-original-file: + * specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MinimumSet_Gen. + * json + */ + /** + * Sample code: UpdateVMMServer - generated by [MinimumSet] rule. + * + * @param manager Entry point to ScvmmManager. + */ + public static void updateVMMServerGeneratedByMinimumSetRule(com.azure.resourcemanager.scvmm.ScvmmManager manager) { + VmmServer resource = manager.vmmServers() + .getByResourceGroupWithResponse("rgscvmm", "-", com.azure.core.util.Context.NONE).getValue(); + resource.update().apply(); } }